PortableGroup_Loader.cpp

Go to the documentation of this file.
00001 // $Id: PortableGroup_Loader.cpp 76601 2007-01-25 19:59:59Z elliott_c $
00002 
00003 #include "orbsvcs/PortableGroup/PortableGroup_Loader.h"
00004 #include "orbsvcs/PortableGroup/PG_Object_Adapter_Factory.h"
00005 #include "orbsvcs/PortableGroup/PortableGroup_ORBInitializer.h"
00006 #include "ace/Dynamic_Service.h"
00007 #include "tao/ORB_Core.h"
00008 #include "tao/ORBInitializer_Registry.h"
00009 
00010 ACE_RCSID (PortableGroup,
00011            PortableGroup_Loader,
00012            "$Id: PortableGroup_Loader.cpp 76601 2007-01-25 19:59:59Z elliott_c $")
00013 
00014 
00015 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00016 
00017 TAO_PortableGroup_Loader::TAO_PortableGroup_Loader (void)
00018 {
00019 }
00020 
00021 int
00022 TAO_PortableGroup_Loader::init (int /*argc*/,
00023                                 char* /*argv*/ [])
00024 {
00025   ACE_TRACE ("TAO_PortableGroup_Loader::init");
00026   // Register the ORB initializer.
00027   try
00028     {
00029       PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
00030         PortableInterceptor::ORBInitializer::_nil ();
00031       PortableInterceptor::ORBInitializer_var orb_initializer;
00032 
00033       /// Register the Portablegroup ORBInitializer.
00034       ACE_NEW_THROW_EX (temp_orb_initializer,
00035                         TAO_PortableGroup_ORBInitializer (),
00036                         CORBA::NO_MEMORY (
00037                           CORBA::SystemException::_tao_minor_code (
00038                             TAO::VMCID,
00039                             ENOMEM),
00040                           CORBA::COMPLETED_NO));
00041       orb_initializer = temp_orb_initializer;
00042 
00043       PortableInterceptor::register_orb_initializer (orb_initializer.in ());
00044     }
00045   catch (const CORBA::Exception& ex)
00046     {
00047       ex._tao_print_exception (
00048         "Unexpected exception caught while initializing the PortableGroup:");
00049       return 1;
00050     }
00051 
00052   return 0;
00053 }
00054 
00055 int
00056 TAO_PortableGroup_Loader::Initializer (void)
00057 {
00058   ACE_Service_Config::process_directive (ace_svc_desc_TAO_PortableGroup_Loader);
00059   TAO_PortableGroup_Loader *tmp =
00060     ACE_Dynamic_Service<TAO_PortableGroup_Loader>::instance (
00061       "PortableGroup_Loader");
00062 
00063   if (tmp != 0)
00064     {
00065       return tmp->init (0, 0);
00066     }
00067 
00068   return -1;
00069 }
00070 
00071 TAO_END_VERSIONED_NAMESPACE_DECL
00072 
00073 ACE_STATIC_SVC_DEFINE (TAO_PortableGroup_Loader,
00074                        ACE_TEXT ("PortableGroup_Loader"),
00075                        ACE_SVC_OBJ_T,
00076                        &ACE_SVC_NAME (TAO_PortableGroup_Loader),
00077                        ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
00078                        0)
00079 ACE_FACTORY_DEFINE (TAO_PortableGroup, TAO_PortableGroup_Loader)

Generated on Tue Feb 2 17:49:50 2010 for TAO_PortableGroup by  doxygen 1.4.7