diff options
Diffstat (limited to 'TAO/tao/RTCORBA/RT_ORBInitializer.cpp')
-rw-r--r-- | TAO/tao/RTCORBA/RT_ORBInitializer.cpp | 118 |
1 files changed, 23 insertions, 95 deletions
diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp index 81ecf82234d..0921e9e8e23 100644 --- a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp +++ b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp @@ -12,14 +12,10 @@ ACE_RCSID (TAO, RT_ORBInitializer, "$Id$") #include "Priority_Mapping_Manager.h" #include "tao/Exception.h" #include "tao/ORB_Core.h" -#include "tao/ORBInitInfo.h" #include "RT_ORB_Loader.h" #include "RT_Stub_Factory.h" #include "RT_Endpoint_Selector_Factory.h" -#include "Linear_Priority_Mapping.h" -#include "Direct_Priority_Mapping.h" -#include "RT_ORB.h" -#include "RT_Current.h" +#include "RT_Thread_Lane_Resources_Manager.h" #include "ace/Service_Repository.h" #include "ace/Svc_Conf.h" @@ -27,10 +23,8 @@ ACE_RCSID (TAO, RT_ORBInitializer, "$Id$") static const char *rt_poa_factory_name = "TAO_RT_POA"; static const char *rt_poa_factory_directive = "dynamic TAO_RT_POA Service_Object * TAO_RTPortableServer:_make_TAO_RT_Object_Adapter_Factory()"; -TAO_RT_ORBInitializer::TAO_RT_ORBInitializer (int priority_mapping_type, - int sched_policy) - : priority_mapping_type_ (priority_mapping_type), - sched_policy_ (sched_policy) +TAO_RT_ORBInitializer::TAO_RT_ORBInitializer (TAO_Priority_Mapping *priority_mapping) + : priority_mapping_ (priority_mapping) { } @@ -42,56 +36,38 @@ TAO_RT_ORBInitializer::pre_init ( { TAO_ENV_ARG_DEFN; + // // Register all of the RT related services. - ACE_Service_Config::process_directive (ace_svc_desc_TAO_RT_Protocols_Hooks); - ACE_Service_Config::process_directive (ace_svc_desc_TAO_RT_Stub_Factory); - ACE_Service_Config::process_directive (ace_svc_desc_RT_Endpoint_Selector_Factory); - - // If the application resolves the root POA, make sure we load the RT POA. - TAO_ORB_Core::set_poa_factory (rt_poa_factory_name, - rt_poa_factory_directive); - -// @@ RTCORBA Subsetting: service gets automatically loaded now by using a static initializer. -// ACE_Service_Config::process_directive (ace_svc_desc_TAO_RT_ORB_Loader); + // // Set the name of the Protocol_Hooks to be the RT_Protocols_Hooks. TAO_ORB_Core::set_protocols_hooks ("RT_Protocols_Hooks"); + ACE_Service_Config::process_directive (ace_svc_desc_TAO_RT_Protocols_Hooks); // Set the name of the stub factory to be the RT_Stub_Factory. TAO_ORB_Core::set_stub_factory ("RT_Stub_Factory"); + ACE_Service_Config::process_directive (ace_svc_desc_TAO_RT_Stub_Factory); // Set the name of the stub factory to be the RT_Stub_Factory. TAO_ORB_Core::set_endpoint_selector_factory ("RT_Endpoint_Selector_Factory"); + ACE_Service_Config::process_directive (ace_svc_desc_RT_Endpoint_Selector_Factory); - // Sets the client_protocol policy. - TAO_RT_Protocols_Hooks::set_client_protocols_hook - (TAO_ClientProtocolPolicy::hook); - - // Sets the server_protocol policy. - TAO_RT_Protocols_Hooks::set_server_protocols_hook - (TAO_ServerProtocolPolicy::hook); + // Set the name of the thread lane resources manager to be the RT_Thread_Lane_Resources_Manager. + TAO_ORB_Core::set_thread_lane_resources_manager ("RT_Thread_Lane_Resources_Manager"); + ACE_Service_Config::process_directive (ace_svc_desc_TAO_RT_Thread_Lane_Resources_Manager); + // If the application resolves the root POA, make sure we load the RT POA. + TAO_ORB_Core::set_poa_factory (rt_poa_factory_name, + rt_poa_factory_directive); - // Create the initial priority mapping instance. - TAO_Priority_Mapping *pm; - switch (this->priority_mapping_type_) - { - case TAO_PRIORITY_MAPPING_LINEAR: - ACE_NEW (pm, - TAO_Linear_Priority_Mapping (this->sched_policy_)); - break; - default: - case TAO_PRIORITY_MAPPING_DIRECT: - ACE_NEW (pm, - TAO_Direct_Priority_Mapping (this->sched_policy_)); - break; - } +// @@ RTCORBA Subsetting: service gets automatically loaded now by using a static initializer. +// ACE_Service_Config::process_directive (ace_svc_desc_TAO_RT_ORB_Loader); // Set the Priority_Mapping_Manager TAO_Priority_Mapping_Manager *manager = 0; ACE_NEW_THROW_EX (manager, - TAO_Priority_Mapping_Manager (pm), + TAO_Priority_Mapping_Manager (this->priority_mapping_), CORBA::NO_MEMORY ( CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, @@ -106,59 +82,13 @@ TAO_RT_ORBInitializer::pre_init ( ACE_TRY_ENV); ACE_CHECK; - // @@ This is busted. TAO_ORBInitInfo should do proper reference - // counting. - // Narrow to a TAO_ORBInitInfo object to get access to the - // orb_core() TAO extension. - TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info, - ACE_TRY_ENV); - ACE_CHECK; - - if (CORBA::is_nil (tao_info.in ())) - { - if (TAO_debug_level > 0) - ACE_ERROR ((LM_ERROR, - "(%P|%t) Security_ORBInitializer::pre_init:\n" - "(%P|%t) Unable to narrow " - "\"PortableInterceptor::ORBInitInfo_ptr\" to\n" - "(%P|%t) \"TAO_ORBInitInfo *.\"\n")); - - ACE_THROW (CORBA::INTERNAL ()); - } - - // Create the RT_ORB. - CORBA::Object_ptr rt_orb = CORBA::Object::_nil (); - ACE_NEW_THROW_EX (rt_orb, - TAO_RT_ORB (tao_info->orb_core ()), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO_DEFAULT_MINOR_CODE, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - CORBA::Object_var safe_rt_orb = rt_orb; - - info->register_initial_reference (TAO_OBJID_RTORB, - rt_orb, - ACE_TRY_ENV); - ACE_CHECK; - - // Create the RT_Current. - CORBA::Object_ptr current; - ACE_NEW_THROW_EX (current, - TAO_RT_Current (tao_info->orb_core ()), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO_DEFAULT_MINOR_CODE, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - CORBA::Object_var safe_rt_current = current; + // Sets the client_protocol policy. + TAO_RT_Protocols_Hooks::set_client_protocols_hook + (TAO_ClientProtocolPolicy::hook); - info->register_initial_reference (TAO_OBJID_RTCURRENT, - current, - ACE_TRY_ENV); - ACE_CHECK; + // Sets the server_protocol policy. + TAO_RT_Protocols_Hooks::set_server_protocols_hook + (TAO_ServerProtocolPolicy::hook); } void @@ -171,7 +101,6 @@ TAO_RT_ORBInitializer::post_init ( this->register_policy_factories (info, ACE_TRY_ENV); - ACE_CHECK; } @@ -209,4 +138,3 @@ TAO_RT_ORBInitializer::register_policy_factories ( ACE_TRY_ENV); ACE_CHECK; } - |