Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / TransportCurrent / IIOP_Current_Loader.cpp
blobd3bc5c6935437426cd6acea994b69b663dc9f466
1 /* -*- C++ -*- */
3 // =================================================================
4 /**
5 * @file IIOP_Current_Loader.cpp
7 * @author Iliyan Jeliazkov <iliyan@ociweb.com>
8 */
9 // =================================================================
12 #include "ace/Service_Config.h"
13 #include "tao/ORBInitializer_Registry.h"
14 #include "tao/ORB_Constants.h"
15 #include "tao/PI/PI.h"
17 #if TAO_HAS_TRANSPORT_CURRENT == 1
19 #include "tao/TransportCurrent/Current_ORBInitializer.h"
20 #include "tao/TransportCurrent/IIOP_Current_Loader.h"
21 #include "tao/TransportCurrent/IIOP_Current_Impl.h"
23 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
25 namespace TAO
27 namespace Transport
29 namespace IIOP
31 /// Initializes object when dynamic linking occurs.
32 int
33 Current_Loader::init (int, ACE_TCHAR *[])
35 PortableInterceptor::ORBInitializer_ptr tmp = 0;
36 ACE_NEW_THROW_EX (tmp,
37 Current_ORBInitializer<IIOP_Current_Impl> (ACE_TEXT ("TAO::Transport::IIOP::Current")),
38 CORBA::NO_MEMORY (CORBA::SystemException::_tao_minor_code (TAO::VMCID,
39 ENOMEM),
40 CORBA::COMPLETED_NO));
42 PortableInterceptor::ORBInitializer_var initializer (tmp);
44 PortableInterceptor::register_orb_initializer (initializer.in ());
46 return 0;
49 Current_Loader::Current_Loader ()
53 Current_Loader::~Current_Loader ()
59 TAO_END_VERSIONED_NAMESPACE_DECL
61 #if defined (TAO_AS_STATIC_LIBS)
63 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
65 ACE_STATIC_SVC_REQUIRE (TAO_Transport_IIOP_Current_Loader)
67 namespace TAO
69 namespace Transport
71 namespace IIOP
73 int current_static_initializer ()
75 ACE_STATIC_SVC_REGISTER (TAO_Transport_IIOP_Current_Loader);
76 return 0;
81 TAO_END_VERSIONED_NAMESPACE_DECL
84 #endif /* defined (TAO_AS_STATIC_LIBS) */
86 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
88 ACE_STATIC_SVC_DEFINE (TAO_Transport_IIOP_Current_Loader,
89 ACE_TEXT ("TAO_Transport_IIOP_Current_Loader"),
90 ACE_SVC_OBJ_T,
91 &ACE_SVC_NAME (TAO_Transport_IIOP_Current_Loader),
92 ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
95 ACE_FACTORY_NAMESPACE_DEFINE (TAO_Transport_Current,
96 TAO_Transport_IIOP_Current_Loader,
97 TAO::Transport::IIOP::Current_Loader)
98 TAO_END_VERSIONED_NAMESPACE_DECL
99 #endif /* TAO_HAS_TRANSPORT_CURRENT == 1 */