Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / tao / Messaging / Messaging_Loader.cpp
blobd77293d13a0023b779232053abb1c7adc92c5278
1 #include "tao/Messaging/Messaging_Loader.h"
2 #include "tao/Messaging/Messaging_ORBInitializer.h"
3 #include "tao/Messaging/AMI_Arguments_Converter_Impl.h"
5 #include "tao/debug.h"
6 #include "tao/ORB_Core.h"
7 #include "tao/ORBInitializer_Registry.h"
9 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
11 TAO_Messaging_Loader::TAO_Messaging_Loader ()
12 : initialized_ (false)
16 TAO_Messaging_Loader::~TAO_Messaging_Loader ()
20 int
21 TAO_Messaging_Loader::init (int, ACE_TCHAR* [])
23 ACE_TRACE ("TAO_Messaging_Loader::init");
25 if (this->initialized_)
26 return 0;
28 this->initialized_ = true;
30 ACE_Service_Gestalt *gestalt = ACE_Service_Config::current ();
32 ACE_Service_Object * const messaging_loader =
33 ACE_Dynamic_Service<ACE_Service_Object>::instance (
34 gestalt,
35 "Messaging_Loader",
36 true);
38 if (messaging_loader != 0 && messaging_loader != this)
40 return messaging_loader->init (0, 0);
43 PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
44 PortableInterceptor::ORBInitializer::_nil ();
45 PortableInterceptor::ORBInitializer_var orb_initializer;
47 try
49 /// Register the Messaging ORBInitializer.
51 ACE_NEW_THROW_EX (temp_orb_initializer,
52 TAO_Messaging_ORBInitializer,
53 CORBA::NO_MEMORY (
54 CORBA::SystemException::_tao_minor_code (
55 TAO::VMCID,
56 ENOMEM),
57 CORBA::COMPLETED_NO));
59 orb_initializer = temp_orb_initializer;
61 PortableInterceptor::register_orb_initializer (orb_initializer.in ());
63 catch (const ::CORBA::Exception& ex)
65 if (TAO_debug_level > 0)
67 ex._tao_print_exception ("Caught exception:");
69 return -1;
72 return 0;
76 /////////////////////////////////////////////////////////////////////
78 ACE_FACTORY_DEFINE (TAO_Messaging, TAO_Messaging_Loader)
79 ACE_STATIC_SVC_DEFINE (TAO_Messaging_Loader,
80 ACE_TEXT ("Messaging_Loader"),
81 ACE_SVC_OBJ_T,
82 &ACE_SVC_NAME (TAO_Messaging_Loader),
83 ACE_Service_Type::DELETE_THIS
84 | ACE_Service_Type::DELETE_OBJ,
87 TAO_END_VERSIONED_NAMESPACE_DECL