#include "orbsvcs/Security/Security_ORBInitializer.h"
#include "orbsvcs/Security/SL3_SecurityCurrent.h"
#include "orbsvcs/Security/SL3_CredentialsCurator.h"
#include "orbsvcs/Security/SL3_SecurityManager.h"
#include "orbsvcs/SecurityC.h"
#include "tao/PI/ORBInitInfo.h"
#include "tao/ORB_Constants.h"
#include "tao/debug.h"
Include dependency graph for Security_ORBInitializer.cpp:
Go to the source code of this file.
Functions | |
ACE_RCSID (Security, Security_ORBInitializer,"Security_ORBInitializer.cpp, v 1.18 2006/03/14 06:14:35 jtc Exp") TAO_BEGIN_VERSIONED_NAMESPACE_DECL void TAO |
|
Definition at line 5 of file Security_ORBInitializer.cpp. References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_ERROR, ACE_NEW_THROW_EX, ACE_THROW, CORBA::is_nil(), LM_ERROR, TAO_BEGIN_VERSIONED_NAMESPACE_DECL, and TAO_debug_level.
00007 :14:35 jtc Exp") 00008 00009 00010 // #include "Security_Current.h" 00011 #include "orbsvcs/Security/SL3_SecurityCurrent.h" 00012 #include "orbsvcs/Security/SL3_CredentialsCurator.h" 00013 #include "orbsvcs/Security/SL3_SecurityManager.h" 00014 00015 #include "orbsvcs/SecurityC.h" 00016 00017 #include "tao/PI/ORBInitInfo.h" 00018 #include "tao/ORB_Constants.h" 00019 #include "tao/debug.h" 00020 00021 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00022 00023 void 00024 TAO::Security::ORBInitializer::pre_init ( 00025 PortableInterceptor::ORBInitInfo_ptr info 00026 ACE_ENV_ARG_DECL) 00027 ACE_THROW_SPEC ((CORBA::SystemException)) 00028 { 00029 // Narrow to a TAO_ORBInitInfo object to get access to the 00030 // allocate_tss_slot_id() TAO extension. 00031 TAO_ORBInitInfo_var tao_info = 00032 TAO_ORBInitInfo::_narrow (info 00033 ACE_ENV_ARG_PARAMETER); 00034 ACE_CHECK; 00035 00036 if (CORBA::is_nil (tao_info.in ())) 00037 { 00038 if (TAO_debug_level > 0) 00039 ACE_ERROR ((LM_ERROR, 00040 "(%P|%t) Security_ORBInitializer::pre_init:\n" 00041 "(%P|%t) Unable to narrow " 00042 "\"PortableInterceptor::ORBInitInfo_ptr\" to\n" 00043 "(%P|%t) \"TAO_ORBInitInfo_ptr.\"\n")); 00044 00045 ACE_THROW (CORBA::INTERNAL ()); 00046 } 00047 00048 // // Reserve a TSS slot in the ORB core internal TSS resources for the 00049 // // thread-specific portion of Security::Current. 00050 // size_t old_tss_slot = tao_info->allocate_tss_slot_id (0 00051 // ACE_ENV_ARG_PARAMETER); 00052 // ACE_CHECK; 00053 00054 // CORBA::String_var orb_id = info->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER); 00055 // ACE_CHECK; 00056 00057 // // Create the SecurityLevel2::Current object. 00058 // SecurityLevel2::Current_ptr current = SecurityLevel2::Current::_nil (); 00059 // ACE_NEW_THROW_EX (current, 00060 // TAO_Security_Current (old_tss_slot, orb_id.in ()), 00061 // CORBA::NO_MEMORY ( 00062 // CORBA::SystemException::_tao_minor_code ( 00063 // TAO::VMCID, 00064 // ENOMEM), 00065 // CORBA::COMPLETED_NO)); 00066 // ACE_CHECK; 00067 00068 // SecurityLevel2::Current_var security_current = current; 00069 00070 // // Register the SecurityLevel2::Current object reference with the 00071 // // ORB. 00072 // info->register_initial_reference ("SecurityCurrent", 00073 // security_current.in () 00074 // ACE_ENV_ARG_PARAMETER); 00075 // ACE_CHECK; 00076 00077 // Reserve a TSS slot in the ORB core internal TSS resources for the 00078 // thread-specific portion of SecurityLevel3::SecurityCurrent 00079 // object. 00080 size_t tss_slot = tao_info->allocate_tss_slot_id (0 00081 ACE_ENV_ARG_PARAMETER); 00082 ACE_CHECK; 00083 00084 00085 // Create the SecurityLevel3::Current object. 00086 SecurityLevel3::SecurityCurrent_ptr current3; 00087 ACE_NEW_THROW_EX (current3, 00088 TAO::SL3::SecurityCurrent (tss_slot, 00089 tao_info->orb_core ()), 00090 CORBA::NO_MEMORY ( 00091 CORBA::SystemException::_tao_minor_code ( 00092 TAO::VMCID, 00093 ENOMEM), 00094 CORBA::COMPLETED_NO)); 00095 ACE_CHECK; 00096 00097 SecurityLevel3::SecurityCurrent_var security_current3 = current3; 00098 00099 // Register the SecurityLevel2::Current object reference with the 00100 // ORB. 00101 info->register_initial_reference ("SecurityLevel3:SecurityCurrent", 00102 security_current3.in () 00103 ACE_ENV_ARG_PARAMETER); 00104 ACE_CHECK; 00105 00106 // Create the SecurityLevel3::CredentialsCurator object. 00107 SecurityLevel3::CredentialsCurator_ptr curator; 00108 ACE_NEW_THROW_EX (curator, 00109 TAO::SL3::CredentialsCurator, 00110 CORBA::NO_MEMORY ( 00111 CORBA::SystemException::_tao_minor_code ( 00112 TAO::VMCID, 00113 ENOMEM), 00114 CORBA::COMPLETED_NO)); 00115 ACE_CHECK; 00116 00117 SecurityLevel3::CredentialsCurator_var credentials_curator = curator; 00118 00119 // Register the SecurityLevel3::CredentialsCurator object reference 00120 // with the ORB. 00121 info->register_initial_reference ("SecurityLevel3:CredentialsCurator", 00122 credentials_curator.in () 00123 ACE_ENV_ARG_PARAMETER); 00124 ACE_CHECK; 00125 00126 // Create the SecurityLevel3::SecurityManager object. 00127 SecurityLevel3::SecurityManager_ptr manager3; 00128 ACE_NEW_THROW_EX (manager3, 00129 TAO::SL3::SecurityManager (credentials_curator.in ()), 00130 CORBA::NO_MEMORY ( 00131 CORBA::SystemException::_tao_minor_code ( 00132 TAO::VMCID, 00133 ENOMEM), 00134 CORBA::COMPLETED_NO)); 00135 ACE_CHECK; 00136 00137 SecurityLevel3::SecurityManager_var security_manager3 = manager3; 00138 00139 // Register the SecurityLevel3::SecurityManager object reference 00140 // with the ORB. 00141 info->register_initial_reference ("SecurityLevel3:SecurityManager", 00142 security_manager3.in () 00143 ACE_ENV_ARG_PARAMETER); 00144 ACE_CHECK; 00145 } |