PortableGroup_ORBInitializer.cpp

Go to the documentation of this file.
00001 // $Id: PortableGroup_ORBInitializer.cpp 78787 2007-07-05 08:02:28Z johnnyw $
00002 
00003 #include "orbsvcs/PortableGroup/PortableGroup_ORBInitializer.h"
00004 #include "orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.h"
00005 
00006 #include "tao/Exception.h"
00007 #include "tao/ORB_Core.h"
00008 #include "tao/PI/ORBInitInfo.h"
00009 #include "tao/debug.h"
00010 
00011 ACE_RCSID (PortableGroup,
00012            PortableGroup_ORBInitializer,
00013            "$Id: PortableGroup_ORBInitializer.cpp 78787 2007-07-05 08:02:28Z johnnyw $")
00014 
00015 static const char pg_poa_factory_name[] = "TAO_GOA";
00016 static const char pg_poa_factory_directive[] = ACE_DYNAMIC_SERVICE_DIRECTIVE(
00017   "TAO_GOA", "TAO_PortableGroup", "_make_TAO_PG_Object_Adapter_Factory", "");
00018 
00019 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00020 
00021 void
00022 TAO_PortableGroup_ORBInitializer::pre_init (
00023     PortableInterceptor::ORBInitInfo_ptr info)
00024 {
00025   // Narrow to a TAO_ORBInitInfo object to get access to the
00026   // orb_core() TAO extension.
00027   TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info);
00028 
00029   if (CORBA::is_nil (tao_info.in ()))
00030     {
00031       if (TAO_debug_level > 0)
00032         ACE_ERROR ((LM_ERROR,
00033                     "(%P|%t) PortableGroup_ORBInitializer::pre_init:\n"
00034                     "(%P|%t)    Unable to narrow "
00035                     "\"PortableInterceptor::ORBInitInfo_ptr\" to\n"
00036                     "(%P|%t)   \"TAO_ORBInitInfo_ptr.\"\n"));
00037 
00038       throw CORBA::INTERNAL ();
00039     }
00040 
00041   // Set a new request dispatcher in the ORB.
00042   PortableGroup_Request_Dispatcher *rd = 0;
00043   ACE_NEW_THROW_EX (rd,
00044                     PortableGroup_Request_Dispatcher (),
00045                     CORBA::NO_MEMORY (
00046                       CORBA::SystemException::_tao_minor_code (
00047                         TAO::VMCID,
00048                         ENOMEM),
00049                       CORBA::COMPLETED_NO));
00050 
00051   tao_info->orb_core ()->request_dispatcher (rd);
00052 
00053   // If the application resolves the root POA, make sure we load the PG POA.
00054   tao_info->orb_core ()->orb_params ()->poa_factory_name (pg_poa_factory_name);
00055   tao_info->orb_core ()->orb_params ()->poa_factory_directive (ACE_TEXT_ALWAYS_CHAR (pg_poa_factory_directive));
00056 }
00057 
00058 void
00059 TAO_PortableGroup_ORBInitializer::post_init (
00060     PortableInterceptor::ORBInitInfo_ptr)
00061 {
00062 }
00063 
00064 TAO_END_VERSIONED_NAMESPACE_DECL

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