Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / EndpointPolicy / EndpointPolicy.cpp
blob5ad9d3b3198517540047e8dd175d4920e225b077
1 // -*- C++ -*-
2 #include "tao/EndpointPolicy/EndpointPolicy.h"
3 #include "tao/EndpointPolicy/EndpointPolicy_ORBInitializer.h"
4 #include "tao/EndpointPolicy/Endpoint_Acceptor_Filter_Factory.h"
6 #include "tao/ORB_Core.h"
7 #include "tao/ORBInitializer_Registry.h"
9 #include "tao/PI/PI.h"
11 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
13 int
14 TAO_EndpointPolicy_Initializer::static_init ()
16 ACE_Service_Config::process_directive (ace_svc_desc_TAO_EndpointPolicy_Initializer);
17 return 0;
20 int
21 TAO_EndpointPolicy_Initializer::init (int, ACE_TCHAR* [])
23 PortableInterceptor::ORBInitializer_var orb_initializer;
25 try
27 PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
28 PortableInterceptor::ORBInitializer::_nil ();
30 /// Register the EndpointPolicy ORBInitializer.
31 ACE_NEW_THROW_EX (temp_orb_initializer,
32 TAO_EndpointPolicy_ORBInitializer,
33 CORBA::NO_MEMORY (
34 CORBA::SystemException::_tao_minor_code (
35 TAO::VMCID,
36 ENOMEM),
37 CORBA::COMPLETED_NO));
39 orb_initializer = temp_orb_initializer;
41 PortableInterceptor::register_orb_initializer (orb_initializer.in ());
43 catch (const ::CORBA::Exception& ex)
45 if (TAO_debug_level > 0)
47 ex._tao_print_exception ("Caught exception:");
49 return -1;
52 ACE_Service_Config::process_directive
53 (ace_svc_desc_TAO_Endpoint_Acceptor_Filter_Factory,1); // force replacement
55 return 0;
59 /////////////////////////////////////////////////////////////////////
61 ACE_FACTORY_DEFINE (TAO_EndpointPolicy, TAO_EndpointPolicy_Initializer)
62 ACE_STATIC_SVC_DEFINE (TAO_EndpointPolicy_Initializer,
63 ACE_TEXT ("EndpointPolicy_Initializer"),
64 ACE_SVC_OBJ_T,
65 &ACE_SVC_NAME (TAO_EndpointPolicy_Initializer),
66 ACE_Service_Type::DELETE_THIS
67 | ACE_Service_Type::DELETE_OBJ,
69 TAO_END_VERSIONED_NAMESPACE_DECL