#include <PI_ORBInitializer.h>
Inheritance diagram for TAO_PI_ORBInitializer:
Public Member Functions | |
PortableInterceptor::ORBInitializer methods | |
The following methods are required by the PortableInterceptor::ORBInitializer interface. | |
void | pre_init (PortableInterceptor::ORBInitInfo_ptr info) |
void | post_init (PortableInterceptor::ORBInitInfo_ptr info) |
Private Member Functions | |
void | register_policy_factories (PortableInterceptor::ORBInitInfo_ptr info) |
Register PortableInterceptor policy factories. | |
Private Attributes | |
PortableInterceptor::PolicyFactory_var | policy_factory_ |
Instance of the PI policy factory. |
Definition at line 37 of file PI_ORBInitializer.h.
void TAO_PI_ORBInitializer::post_init | ( | PortableInterceptor::ORBInitInfo_ptr | info | ) |
Definition at line 26 of file PI_ORBInitializer.cpp.
References CORBA::SystemException::_tao_minor_code(), ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, CORBA::is_nil(), policy_factory_, register_policy_factories(), and TAO::VMCID.
00027 { 00028 // The PI policy factory is stateless and reentrant, so share a 00029 // single instance between all ORBs. 00030 if (CORBA::is_nil (this->policy_factory_.in ())) 00031 { 00032 PortableInterceptor::PolicyFactory_ptr policy_factory; 00033 ACE_NEW_THROW_EX (policy_factory, 00034 TAO_PI_PolicyFactory, 00035 CORBA::NO_MEMORY ( 00036 CORBA::SystemException::_tao_minor_code ( 00037 TAO::VMCID, 00038 ENOMEM), 00039 CORBA::COMPLETED_NO)); 00040 00041 this->policy_factory_ = policy_factory; 00042 } 00043 00044 this->register_policy_factories (info); 00045 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL void TAO_PI_ORBInitializer::pre_init | ( | PortableInterceptor::ORBInitInfo_ptr | info | ) |
void TAO_PI_ORBInitializer::register_policy_factories | ( | PortableInterceptor::ORBInitInfo_ptr | info | ) | [private] |
Register PortableInterceptor policy factories.
Definition at line 49 of file PI_ORBInitializer.cpp.
References CORBA::OMGVMCID.
Referenced by post_init().
00051 { 00052 // Register the PI policy factory. 00053 00054 // Bind the same policy factory to all PortableInterceptor related policy 00055 // types since a single policy factory is used to create each of the 00056 // different types of PortableInterceptor policies. 00057 CORBA::PolicyType type[] = { 00058 PortableInterceptor::PROCESSING_MODE_POLICY_TYPE 00059 }; 00060 00061 const CORBA::PolicyType *end = type + sizeof (type) / sizeof (type[0]); 00062 00063 for (CORBA::PolicyType *i = type; i != end; ++i) 00064 { 00065 try 00066 { 00067 info->register_policy_factory (*i, this->policy_factory_.in ()); 00068 } 00069 catch (const ::CORBA::BAD_INV_ORDER& ex) 00070 { 00071 if (ex.minor () == (CORBA::OMGVMCID | 16)) 00072 { 00073 // The factory is already there, it happens because the 00074 // magic initializer in PI_Initializer.cpp registers 00075 // with the ORB multiple times. This is an indication 00076 // that we should do no more work in this 00077 // ORBInitializer. 00078 return; 00079 } 00080 throw; 00081 } 00082 } 00083 }
Instance of the PI policy factory.
The PI policy factory is stateless and reentrant, so share a single instance between all ORBs.
Definition at line 65 of file PI_ORBInitializer.h.
Referenced by post_init().