#include <PortableServer_ORBInitializer.h>
Inheritance diagram for TAO_PortableServer_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 PortableServer policy factories. |
Definition at line 29 of file PortableServer_ORBInitializer.h.
void TAO_PortableServer_ORBInitializer::post_init | ( | PortableInterceptor::ORBInitInfo_ptr | info | ) |
Definition at line 25 of file PortableServer_ORBInitializer.cpp.
References register_policy_factories().
00027 { 00028 this->register_policy_factories (info); 00029 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL void TAO_PortableServer_ORBInitializer::pre_init | ( | PortableInterceptor::ORBInitInfo_ptr | info | ) |
void TAO_PortableServer_ORBInitializer::register_policy_factories | ( | PortableInterceptor::ORBInitInfo_ptr | info | ) | [private] |
Register PortableServer policy factories.
Definition at line 32 of file PortableServer_ORBInitializer.cpp.
References CORBA::SystemException::_tao_minor_code(), ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, CORBA::OMGVMCID, and TAO::VMCID.
Referenced by post_init().
00034 { 00035 #if !defined (CORBA_E_MICRO) 00036 // Register the PortableServer policy factories. 00037 PortableInterceptor::PolicyFactory_ptr tmp; 00038 ACE_NEW_THROW_EX (tmp, 00039 TAO_PortableServer_PolicyFactory, 00040 CORBA::NO_MEMORY ( 00041 CORBA::SystemException::_tao_minor_code ( 00042 TAO::VMCID, 00043 ENOMEM), 00044 CORBA::COMPLETED_NO)); 00045 00046 PortableInterceptor::PolicyFactory_var policy_factory = tmp; 00047 00048 // Bind the same policy factory to all PortableServer related policy 00049 // types since a single policy factory is used to create each of the 00050 // different types of PortableServer policies. 00051 static CORBA::PolicyType const type[] = { 00052 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) 00053 PortableServer::THREAD_POLICY_ID, 00054 PortableServer::IMPLICIT_ACTIVATION_POLICY_ID, 00055 PortableServer::SERVANT_RETENTION_POLICY_ID, 00056 PortableServer::REQUEST_PROCESSING_POLICY_ID, 00057 #endif /* TAO_HAS_MINIMUM_POA == 0 */ 00058 PortableServer::LIFESPAN_POLICY_ID, 00059 PortableServer::ID_UNIQUENESS_POLICY_ID, 00060 PortableServer::ID_ASSIGNMENT_POLICY_ID 00061 }; 00062 00063 CORBA::PolicyType const * end = 00064 type + sizeof (type) / sizeof (type[0]); 00065 00066 for (CORBA::PolicyType const *i = type; 00067 i != end; 00068 ++i) 00069 { 00070 try 00071 { 00072 info->register_policy_factory (*i, policy_factory.in ()); 00073 } 00074 catch (const ::CORBA::BAD_INV_ORDER& ex) 00075 { 00076 if (ex.minor () == (CORBA::OMGVMCID | 16)) 00077 { 00078 // The factory is already there, it happens because the 00079 // magic initializer in PortableServer.cpp registers 00080 // with the ORB multiple times. This is an indication 00081 // that we should do no more work in this 00082 // ORBInitializer. 00083 return; 00084 } 00085 throw; 00086 } 00087 } 00088 #else 00089 ACE_UNUSED_ARG (info); 00090 #endif 00091 }