1 #include "tao/EndpointPolicy/EndpointPolicy_ORBInitializer.h"
3 #include "tao/EndpointPolicy/EndpointPolicyC.h"
4 #include "tao/EndpointPolicy/EndpointPolicy_Factory.h"
5 #include "tao/ORB_Core.h"
6 #include "tao/PI/ORBInitInfo.h"
8 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
11 TAO_EndpointPolicy_ORBInitializer::pre_init (
12 PortableInterceptor::ORBInitInfo_ptr
)
17 TAO_EndpointPolicy_ORBInitializer::post_init (
18 PortableInterceptor::ORBInitInfo_ptr info
)
20 this->register_policy_factories (info
);
24 TAO_EndpointPolicy_ORBInitializer::register_policy_factories (
25 PortableInterceptor::ORBInitInfo_ptr info
)
27 TAO_ORBInitInfo
* local_info
= dynamic_cast <TAO_ORBInitInfo
*> (info
);
30 throw CORBA::INTERNAL ();
32 TAO_ORB_Core
* the_orb_core
= local_info
->orb_core ();
34 // Register the EndpointPolicy policy factories.
35 PortableInterceptor::PolicyFactory_ptr policy_factory_ptr
;
36 ACE_NEW_THROW_EX (policy_factory_ptr
,
37 TAO_EndpointPolicy_Factory(the_orb_core
),
39 CORBA::SystemException::_tao_minor_code (
42 CORBA::COMPLETED_NO
));
45 PortableInterceptor::PolicyFactory_var policy_factory
=
50 info
->register_policy_factory (EndpointPolicy::ENDPOINT_POLICY_TYPE
,
51 policy_factory
.in ());
53 catch (const ::CORBA::BAD_INV_ORDER
& ex
)
55 if (ex
.minor () == (CORBA::OMGVMCID
| 16))
57 // The factory is already there, it happens because the
58 // magic initializer in Messaging.cpp registers with the
59 // ORB multiple times. This is an indication that we
60 // should do no more work in this ORBInitializer.
67 TAO_END_VERSIONED_NAMESPACE_DECL