00001 #include "tao/CSD_Framework/CSD_ORBInitializer.h" 00002 00003 ACE_RCSID (CSD, 00004 CSD_ORBInitializer, 00005 "$Id: CSD_ORBInitializer.cpp 82970 2008-10-08 08:41:05Z johnnyw $") 00006 00007 00008 #include "tao/Exception.h" 00009 #include "tao/ORB_Core.h" 00010 #include "tao/PI/ORBInitInfo.h" 00011 #include "tao/debug.h" 00012 00013 static const ACE_TCHAR csd_poa_factory_directive[] = 00014 ACE_DYNAMIC_SERVICE_DIRECTIVE( 00015 "TAO_CSD_Object_Adapter_Factory", 00016 "TAO_CSD_Framework", 00017 "_make_TAO_CSD_Object_Adapter_Factory", 00018 ""); 00019 00020 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00021 00022 void 00023 TAO_CSD_ORBInitializer::pre_init (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) TAO_CSD_ORBInitializer::pre_init:\n" 00034 "(%P|%t) Unable to narrow " 00035 "\"PortableInterceptor::ORBInitInfo_ptr\" to\n" 00036 "(%P|%t) \"TAO_ORBInitInfo *.\"\n")); 00037 00038 throw ::CORBA::INTERNAL (); 00039 } 00040 00041 // If the application resolves the root POA, make sure we load the CSD POA. 00042 tao_info->orb_core ()->orb_params ()->poa_factory_name ("TAO_CSD_Object_Adapter_Factory"); 00043 00044 tao_info->orb_core ()->orb_params ()->poa_factory_directive (csd_poa_factory_directive); 00045 } 00046 00047 void 00048 TAO_CSD_ORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr) 00049 { 00050 } 00051 00052 TAO_END_VERSIONED_NAMESPACE_DECL 00053