PI_Server_Loader.cpp

Go to the documentation of this file.
00001 
00002 // $Id: PI_Server_Loader.cpp 79209 2007-08-05 18:58:56Z johnnyw $
00003 
00004 #include "tao/PI_Server/PI_Server_Loader.h"
00005 #include "tao/PI_Server/PortableServer_ORBInitializer.h"
00006 
00007 #include "tao/debug.h"
00008 #include "tao/ORB_Core.h"
00009 #include "tao/ORBInitializer_Registry.h"
00010 
00011 ACE_RCSID (PI_Server,
00012            PI_Server_Loader,
00013            "$Id: PI_Server_Loader.cpp 79209 2007-08-05 18:58:56Z johnnyw $")
00014 
00015 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00016 
00017 TAO_PI_Server_Loader::TAO_PI_Server_Loader (void)
00018 {
00019 }
00020 
00021 TAO_PI_Server_Loader::~TAO_PI_Server_Loader (void)
00022 {
00023 }
00024 
00025 int
00026 TAO_PI_Server_Loader::init (int, ACE_TCHAR* [])
00027 {
00028   ACE_TRACE ("TAO_PI_Server_Loader::init");
00029 
00030   static bool initialized = false;
00031 
00032   // Only allow initialization once.
00033   if (initialized)
00034     return 0;
00035 
00036   initialized = true;
00037 
00038   // Register the ORB initializer.
00039   try
00040     {
00041       /// Register the Messaging ORBInitializer.
00042       PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
00043         PortableInterceptor::ORBInitializer::_nil ();
00044 
00045       ACE_NEW_THROW_EX (temp_orb_initializer,
00046                         TAO_PortableServer_ORBInitializer,
00047                         CORBA::NO_MEMORY (
00048                           CORBA::SystemException::_tao_minor_code (
00049                             TAO::VMCID,
00050                             ENOMEM),
00051                           CORBA::COMPLETED_NO));
00052 
00053       PortableInterceptor::ORBInitializer_var orb_initializer =
00054         temp_orb_initializer;
00055 
00056       PortableInterceptor::register_orb_initializer (orb_initializer.in ());
00057     }
00058   catch (const ::CORBA::Exception& ex)
00059     {
00060       ex._tao_print_exception ("Caught exception:");
00061       return -1;
00062     }
00063 
00064   return 0;
00065 }
00066 
00067 TAO_END_VERSIONED_NAMESPACE_DECL
00068 
00069 /////////////////////////////////////////////////////////////////////
00070 
00071 ACE_FACTORY_DEFINE (TAO_PI_Server, TAO_PI_Server_Loader)
00072 ACE_STATIC_SVC_DEFINE (TAO_PI_Server_Loader,
00073                        ACE_TEXT ("PI_Server_Loader"),
00074                        ACE_SVC_OBJ_T,
00075                        &ACE_SVC_NAME (TAO_PI_Server_Loader),
00076                        ACE_Service_Type::DELETE_THIS
00077                        | ACE_Service_Type::DELETE_OBJ,
00078                        0)

Generated on Tue Feb 2 17:42:14 2010 for TAO_PI_Server by  doxygen 1.4.7