00001
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 "PortableGroup_ORBInitializer.cpp,v 1.12 2006/03/14 06:14:34 jtc Exp")
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 ACE_ENV_ARG_DECL)
00025 ACE_THROW_SPEC ((CORBA::SystemException))
00026 {
00027
00028
00029 TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info
00030 ACE_ENV_ARG_PARAMETER);
00031 ACE_CHECK;
00032
00033 if (CORBA::is_nil (tao_info.in ()))
00034 {
00035 if (TAO_debug_level > 0)
00036 ACE_ERROR ((LM_ERROR,
00037 "(%P|%t) PortableGroup_ORBInitializer::pre_init:\n"
00038 "(%P|%t) Unable to narrow "
00039 "\"PortableInterceptor::ORBInitInfo_ptr\" to\n"
00040 "(%P|%t) \"TAO_ORBInitInfo_ptr.\"\n"));
00041
00042 ACE_THROW (CORBA::INTERNAL ());
00043 }
00044
00045
00046 PortableGroup_Request_Dispatcher *rd = 0;
00047 ACE_NEW_THROW_EX (rd,
00048 PortableGroup_Request_Dispatcher (),
00049 CORBA::NO_MEMORY (
00050 CORBA::SystemException::_tao_minor_code (
00051 TAO::VMCID,
00052 ENOMEM),
00053 CORBA::COMPLETED_NO));
00054 ACE_CHECK;
00055
00056 tao_info->orb_core ()->request_dispatcher (rd);
00057
00058
00059 TAO_ORB_Core::set_poa_factory (pg_poa_factory_name,
00060 pg_poa_factory_directive);
00061 }
00062
00063 void
00064 TAO_PortableGroup_ORBInitializer::post_init (
00065 PortableInterceptor::ORBInitInfo_ptr
00066 ACE_ENV_ARG_DECL_NOT_USED)
00067 ACE_THROW_SPEC ((CORBA::SystemException))
00068 {
00069 }
00070
00071 TAO_END_VERSIONED_NAMESPACE_DECL