diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-07-05 08:02:28 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-07-05 08:02:28 +0000 |
commit | a6eb73273cadcd19f6324431c901af91fbbca3fb (patch) | |
tree | bd880ef25c19c88a43a7b6d89c2620fa37b668a1 /TAO | |
parent | 3ae3a7221185df87048748b9b6c27bf9f7e4de31 (diff) | |
download | ATCD-a6eb73273cadcd19f6324431c901af91fbbca3fb.tar.gz |
Thu Jul 5 08:01:00 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO')
25 files changed, 539 insertions, 209 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index db24eb1b3ec..ff6cd5e6d3a 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,60 @@ +Thu Jul 5 08:01:00 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/ORB_Core.cpp: + * tao/ORB_Core.h: + * tao/params.cpp: + * tao/params.h: + Moved several ORB configuration settins out of the static resources + into the ORB params. With the introduction of the service gestalt + the static resources where handled to have an instance for each ORB + which leads to problems with RTCORBA. Now explicitly changed these + settings to have a value for each ORB, this makes it also possible + to mix RT and non RT ORBs/POAs in one process, but using the ORB + Initializer we can make sure all RTORBs get the correct value. + This fixes bugzilla 2953. + + * MPC/config/strategies.mpb: + Strategies library needs PI + + * orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.cpp: + * orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.cpp: + Changed to set the endpoint selector factory name on each ORB + instance using the ORB Initializer + + * orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp: + Changed to set the POA name in each ORB instance + + * tao/CSD_Framework/CSD_Framework_Loader.cpp: + * tao/CSD_Framework/CSD_Object_Adapter.h: + * tao/CSD_Framework/CSD_ORBInitializer.cpp: + * tao/CSD_Framework/CSD_ORBInitializer.h: + Added an ORB Initializer to set the POA name in each ORB instance + instead of setting it in the ORB static resources + + * tao/EndpointPolicy/EndpointPolicy_ORBInitializer.cpp: + * tao/ORBInitializer_Registry.cpp: + * tao/PI/PolicyFactory_Registry.cpp: + * tao/PortableServer/Object_Adapter.cpp: + Layout changes + + * tao/RTCORBA/RT_ORBInitializer.cpp: + Set all values into the ORB we are now initializing instead of + into the static resources + + * tao/Strategies.mpc: + * tao/Strategies/OC_Endpoint_Selector_Factory.cpp: + * tao/Strategies/OC_Endpoint_Selector_Factory.h: + * tao/Strategies/Strategies_ORBInitializer.cpp: + * tao/Strategies/Strategies_ORBInitializer.h + Added ORB Initializer to set the endpoint selector factory, because + of this the strategies library now also depends on PI + + * tao/TAO_Internal.cpp: + Don't initialize the POA here, do that in the ORB + + * tao/Valuetype/ValueFactory_Map.cpp: + No need to include TAO_Singleton + Thu Jul 5 06:22:00 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> * orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp: diff --git a/TAO/MPC/config/strategies.mpb b/TAO/MPC/config/strategies.mpb index ae5383f50cb..61389c68494 100644 --- a/TAO/MPC/config/strategies.mpb +++ b/TAO/MPC/config/strategies.mpb @@ -1,6 +1,6 @@ // -*- MPC -*- // $Id$ -project : taolib, anytypecode, core_strategies { +project : taolib, anytypecode, pi, core_strategies { after += Strategies libs += TAO_Strategies } diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.cpp index 5798a1cbcd4..3ebdb7ef8b2 100644 --- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.cpp +++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.cpp @@ -3,7 +3,10 @@ #include "orbsvcs/FaultTolerance/FT_ClientORBInitializer.h" #include "orbsvcs/FaultTolerance/FT_ClientPolicyFactory.h" #include "orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h" +#include "orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.h" #include "orbsvcs/FT_CORBA_ORBC.h" +#include "tao/PI/ORBInitInfo.h" +#include "tao/ORB_Core.h" #include "tao/Exception.h" #include "tao/ORB_Constants.h" @@ -14,8 +17,13 @@ ACE_RCSID (FaultTolerance, TAO_BEGIN_VERSIONED_NAMESPACE_DECL void -TAO_FT_ClientORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr) +TAO_FT_ClientORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr info) { + TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info); + + // Set the name of the endpoint selector factory + tao_info->orb_core ()->orb_params ()->endpoint_selector_factory_name ("FT_Endpoint_Selector_Factory"); + ACE_Service_Config::process_directive (ace_svc_desc_TAO_FT_Endpoint_Selector_Factory); } void diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.cpp index 4d84c639da7..784e1c4dd8b 100644 --- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.cpp +++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.cpp @@ -1,7 +1,6 @@ #include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h" #include "orbsvcs/FaultTolerance/FT_Service_Callbacks.h" #include "orbsvcs/FaultTolerance/FT_ClientORBInitializer.h" -#include "orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.h" #include "tao/ORB_Core.h" #include "tao/Service_Callbacks.h" #include "tao/ORBInitializer_Registry.h" @@ -47,21 +46,17 @@ TAO_FT_ClientService_Activate::Initializer (void) PortableInterceptor::ORBInitializer_ptr temp_orb_initializer = PortableInterceptor::ORBInitializer::_nil (); - PortableInterceptor::ORBInitializer_var orb_initializer; // Register the RTCORBA ORBInitializer. ACE_NEW_RETURN (temp_orb_initializer, TAO_FT_ClientORBInitializer, -1); - orb_initializer = temp_orb_initializer; + PortableInterceptor::ORBInitializer_var orb_initializer = + temp_orb_initializer; PortableInterceptor::register_orb_initializer (orb_initializer.in ()); - // Set the name of the endpoint selector factory - TAO_ORB_Core::set_endpoint_selector_factory ("FT_Endpoint_Selector_Factory"); - ACE_Service_Config::process_directive (ace_svc_desc_TAO_FT_Endpoint_Selector_Factory); - initialized = true; } diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp index 5fea4c9686a..1b9aa199347 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp @@ -51,8 +51,8 @@ TAO_PortableGroup_ORBInitializer::pre_init ( tao_info->orb_core ()->request_dispatcher (rd); // If the application resolves the root POA, make sure we load the PG POA. - TAO_ORB_Core::set_poa_factory (pg_poa_factory_name, - pg_poa_factory_directive); + tao_info->orb_core ()->orb_params ()->poa_factory_name (pg_poa_factory_name); + tao_info->orb_core ()->orb_params ()->poa_factory_directive (ACE_TEXT_ALWAYS_CHAR (pg_poa_factory_directive)); } void diff --git a/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp b/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp index dcdcc711e48..44aa84728ff 100644 --- a/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp +++ b/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp @@ -3,6 +3,8 @@ #include "tao/CSD_Framework/CSD_Framework_Loader.h" #include "tao/CSD_Framework/CSD_Object_Adapter_Factory.h" #include "tao/CSD_Framework/CSD_Strategy_Repository.h" +#include "tao/CSD_Framework/CSD_ORBInitializer.h" +#include "tao/ORBInitializer_Registry.h" #include "ace/Dynamic_Service.h" #include "ace/Service_Gestalt.h" @@ -21,10 +23,35 @@ TAO_CSD_Framework_Loader::init (void) (ace_svc_desc_TAO_CSD_Object_Adapter_Factory); ACE_Service_Config::process_directive - (ace_svc_desc_TAO_CSD_Strategy_Repository); - - TAO_ORB_Core::set_poa_factory ("TAO_CSD_Object_Adapter_Factory", - "dynamic TAO_CSD_Object_Adapter_Factory Service_Object * TAO_CSD_Framework:_make_TAO_CSD_Object_Adapter_Factory()"); + (ace_svc_desc_TAO_CSD_Strategy_Repository); + + // Register the ORB initializer. + try + { + PortableInterceptor::ORBInitializer_ptr temp_orb_initializer = + PortableInterceptor::ORBInitializer::_nil (); + + /// Register the RTCORBA ORBInitializer. + ACE_NEW_THROW_EX (temp_orb_initializer, + TAO_CSD_ORBInitializer, + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + TAO::VMCID, + ENOMEM), + CORBA::COMPLETED_NO)); + + PortableInterceptor::ORBInitializer_var orb_initializer; + orb_initializer = temp_orb_initializer; + + PortableInterceptor::register_orb_initializer (orb_initializer.in ()); + } + catch (const ::CORBA::Exception& ex) + { + ex._tao_print_exception ( + "Unexpected exception caught while " + "initializing the CSD Framework"); + return 1; + } return 0; } diff --git a/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp b/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp new file mode 100644 index 00000000000..b3555b94a4c --- /dev/null +++ b/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp @@ -0,0 +1,46 @@ +#include "tao/CSD_Framework/CSD_ORBInitializer.h" + +ACE_RCSID (CSD, + CSD_ORBInitializer, + "$Id$") + + +#include "tao/Exception.h" +#include "tao/ORB_Core.h" +#include "tao/PI/ORBInitInfo.h" +#include "tao/debug.h" + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +void +TAO_CSD_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr info) +{ + // Narrow to a TAO_ORBInitInfo object to get access to the + // orb_core() TAO extension. + TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info); + + if (CORBA::is_nil (tao_info.in ())) + { + if (TAO_debug_level > 0) + ACE_ERROR ((LM_ERROR, + "(%P|%t) TAO_CSD_ORBInitializer::pre_init:\n" + "(%P|%t) Unable to narrow " + "\"PortableInterceptor::ORBInitInfo_ptr\" to\n" + "(%P|%t) \"TAO_ORBInitInfo *.\"\n")); + + throw ::CORBA::INTERNAL (); + } + + // If the application resolves the root POA, make sure we load the CSD POA. + tao_info->orb_core ()->orb_params ()->poa_factory_name ("TAO_CSD_Object_Adapter_Factory"); + + tao_info->orb_core ()->orb_params ()->poa_factory_directive ("dynamic TAO_CSD_Object_Adapter_Factory Service_Object * TAO_CSD_Framework:_make_TAO_CSD_Object_Adapter_Factory()"); +} + +void +TAO_CSD_ORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr) +{ +} + +TAO_END_VERSIONED_NAMESPACE_DECL + diff --git a/TAO/tao/CSD_Framework/CSD_ORBInitializer.h b/TAO/tao/CSD_Framework/CSD_ORBInitializer.h new file mode 100644 index 00000000000..7b85d86fe57 --- /dev/null +++ b/TAO/tao/CSD_Framework/CSD_ORBInitializer.h @@ -0,0 +1,57 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file CSD_ORBInitializer.h + * + * $Id$ + * + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + + +#ifndef TAO_CSD_ORB_INITIALIZER_H +#define TAO_CSD_ORB_INITIALIZER_H + +#include /**/ "ace/pre.h" + +#include "tao/orbconf.h" + +#include "tao/CSD_Framework/CSD_FW_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PI/PI.h" +#include "tao/LocalObject.h" + +// This is to remove "inherits via dominance" warnings from MSVC. +// MSVC is being a little too paranoid. +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +class TAO_CSD_ORBInitializer + : public virtual PortableInterceptor::ORBInitializer + , public virtual TAO_Local_RefCounted_Object +{ +public: + virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info); + + virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info); +}; + +TAO_END_VERSIONED_NAMESPACE_DECL + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#include /**/ "ace/post.h" + +#endif /* TAO_CSD_ORB_INITIALIZER_H */ diff --git a/TAO/tao/CSD_Framework/CSD_Object_Adapter.h b/TAO/tao/CSD_Framework/CSD_Object_Adapter.h index 6a9346e75cc..f85ef6b26bc 100644 --- a/TAO/tao/CSD_Framework/CSD_Object_Adapter.h +++ b/TAO/tao/CSD_Framework/CSD_Object_Adapter.h @@ -47,8 +47,7 @@ public: /// Hand the request to the Service_Dispatching_Strategy_Proxy for /// dispatching. virtual void do_dispatch (TAO_ServerRequest& req, - TAO::Portable_Server::Servant_Upcall& upcall - ); + TAO::Portable_Server::Servant_Upcall& upcall); }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/EndpointPolicy/EndpointPolicy_ORBInitializer.cpp b/TAO/tao/EndpointPolicy/EndpointPolicy_ORBInitializer.cpp index 1e2d17c9c18..3a60e15a0f0 100644 --- a/TAO/tao/EndpointPolicy/EndpointPolicy_ORBInitializer.cpp +++ b/TAO/tao/EndpointPolicy/EndpointPolicy_ORBInitializer.cpp @@ -15,8 +15,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL void TAO_EndpointPolicy_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ) + PortableInterceptor::ORBInitInfo_ptr) { } @@ -25,14 +24,12 @@ TAO_EndpointPolicy_ORBInitializer::post_init ( PortableInterceptor::ORBInitInfo_ptr info ) { - this->register_policy_factories (info - ); + this->register_policy_factories (info); } void TAO_EndpointPolicy_ORBInitializer::register_policy_factories ( - PortableInterceptor::ORBInitInfo_ptr info - ) + PortableInterceptor::ORBInitInfo_ptr info) { TAO_ORBInitInfo * local_info = dynamic_cast <TAO_ORBInitInfo *> (info); diff --git a/TAO/tao/ORBInitializer_Registry.cpp b/TAO/tao/ORBInitializer_Registry.cpp index 533b348acc1..1259646eace 100644 --- a/TAO/tao/ORBInitializer_Registry.cpp +++ b/TAO/tao/ORBInitializer_Registry.cpp @@ -62,7 +62,6 @@ namespace PortableInterceptor ACE_Dynamic_Service<TAO::ORBInitializer_Registry_Adapter>::instance ("ORBInitializer_Registry"); } - #endif /* !TAO_AS_STATIC_LIBS */ if (orbinitializer_registry_ != 0) diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index a2724c0905b..9aa4121b4f3 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -148,30 +148,17 @@ TAO_ORB_Core_Static_Resources::instance (void) TAO_ORB_Core_Static_Resources::TAO_ORB_Core_Static_Resources (void) : sync_scope_hook_ (0), - protocols_hooks_name_ ("Protocols_Hooks"), network_priority_protocols_hooks_name_ ( "Network_Priority_Protocols_Hooks"), timeout_hook_ (0), connection_timeout_hook_ (0), - endpoint_selector_factory_name_ ("Default_Endpoint_Selector_Factory"), - thread_lane_resources_manager_factory_name_ - ("Default_Thread_Lane_Resources_Manager_Factory"), - collocation_resolver_name_ ("Default_Collocation_Resolver"), - stub_factory_name_ ("Default_Stub_Factory"), resource_factory_name_ ("Resource_Factory"), dynamic_adapter_name_ ("Dynamic_Adapter"), ifr_client_adapter_name_ ("IFR_Client_Adapter"), typecodefactory_adapter_name_ ("TypeCodeFactory_Adapter"), iorinterceptor_adapter_factory_name_ ("IORInterceptor_Adapter_Factory"), valuetype_adapter_factory_name_ ("Valuetype_Adapter_Factory"), - poa_factory_name_ ("TAO_Object_Adapter_Factory"), - poa_factory_directive_ - (ACE_TEXT_ALWAYS_CHAR - (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Object_Adapter_Factory", - "TAO_PortableServer", - "_make_TAO_Object_Adapter_Factory", - ""))), alt_connection_timeout_hook_ (0) { } @@ -180,17 +167,11 @@ TAO_ORB_Core_Static_Resources& TAO_ORB_Core_Static_Resources::operator=(const TAO_ORB_Core_Static_Resources& other) { this->sync_scope_hook_ = other.sync_scope_hook_; - this->protocols_hooks_name_ = other.protocols_hooks_name_; this->network_priority_protocols_hooks_name_ = other.network_priority_protocols_hooks_name_; this->timeout_hook_ = other.timeout_hook_; this->connection_timeout_hook_ = other.connection_timeout_hook_; - this->endpoint_selector_factory_name_ = - other.endpoint_selector_factory_name_; - this->thread_lane_resources_manager_factory_name_ = - other.thread_lane_resources_manager_factory_name_; this->collocation_resolver_name_ = other.collocation_resolver_name_; - this->stub_factory_name_ = other.stub_factory_name_; this->resource_factory_name_ = other.resource_factory_name_; this->dynamic_adapter_name_ = other.dynamic_adapter_name_; this->ifr_client_adapter_name_ = other.ifr_client_adapter_name_; @@ -199,8 +180,6 @@ TAO_ORB_Core_Static_Resources::operator=(const TAO_ORB_Core_Static_Resources& ot other.iorinterceptor_adapter_factory_name_; this->valuetype_adapter_factory_name_ = other.valuetype_adapter_factory_name_; - this->poa_factory_name_ = other.poa_factory_name_; - this->poa_factory_directive_ = other.poa_factory_directive_; this->alt_connection_timeout_hook_ = other.alt_connection_timeout_hook_; return *this; } @@ -1333,13 +1312,12 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) this->flushing_strategy_ = trf->create_flushing_strategy (); // Look in the service repository for an instance of the Protocol Hooks. - const ACE_CString &protocols_hooks_name = - TAO_ORB_Core_Static_Resources::instance ()->protocols_hooks_name_; + const char *protocols_hooks_name = this->orb_params ()->protocols_hooks_name (); this->protocols_hooks_ = ACE_Dynamic_Service<TAO_Protocols_Hooks>::instance (this->configuration (), - ACE_TEXT_CHAR_TO_TCHAR (protocols_hooks_name.c_str())); + ACE_TEXT_CHAR_TO_TCHAR (protocols_hooks_name)); if (this->protocols_hooks_ != 0) { @@ -1347,6 +1325,17 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) this->protocols_hooks_->init_hooks (this); } + // If available, allow the Adapter Factory to setup. + ACE_Service_Object *adapter_factory = + ACE_Dynamic_Service<ACE_Service_Object>::instance ( + this->configuration (), + this->orb_params ()->poa_factory_name ()); + + if (adapter_factory != 0) + { + adapter_factory->init (0, 0); + } + // Look in the service repository for an instance of the // Network Priority Protocol Hooks. const ACE_CString &network_priority_protocols_hooks_name = @@ -1438,13 +1427,6 @@ TAO_ORB_Core::fini (void) } void -TAO_ORB_Core::set_thread_lane_resources_manager_factory (const char *thread_lane_resources_manager_factory_name) -{ - TAO_ORB_Core_Static_Resources::instance ()->thread_lane_resources_manager_factory_name_ = - thread_lane_resources_manager_factory_name; -} - -void TAO_ORB_Core::set_collocation_resolver (const char *collocation_resolver_name) { TAO_ORB_Core_Static_Resources::instance ()->collocation_resolver_name_ = @@ -1452,13 +1434,6 @@ TAO_ORB_Core::set_collocation_resolver (const char *collocation_resolver_name) } void -TAO_ORB_Core::set_stub_factory (const char *stub_factory_name) -{ - TAO_ORB_Core_Static_Resources::instance ()->stub_factory_name_ = - stub_factory_name; -} - -void TAO_ORB_Core::set_resource_factory (const char *resource_factory_name) { TAO_ORB_Core_Static_Resources::instance ()->resource_factory_name_ = @@ -1577,13 +1552,13 @@ TAO_ORB_Core::thread_lane_resources_manager (void) return *this->thread_lane_resources_manager_; // If not, lookup the corresponding factory and ask it to make one. - const ACE_CString &thread_lane_resources_manager_factory_name = - TAO_ORB_Core_Static_Resources::instance ()->thread_lane_resources_manager_factory_name_; + const char *thread_lane_resources_manager_factory_name = + this->orb_params ()->thread_lane_resources_manager_factory_name (); TAO_Thread_Lane_Resources_Manager_Factory *factory = ACE_Dynamic_Service<TAO_Thread_Lane_Resources_Manager_Factory>::instance (this->configuration (), - ACE_TEXT_CHAR_TO_TCHAR (thread_lane_resources_manager_factory_name.c_str())); + ACE_TEXT_CHAR_TO_TCHAR (thread_lane_resources_manager_factory_name)); this->thread_lane_resources_manager_ = factory->create_thread_lane_resources_manager (*this); @@ -1683,40 +1658,17 @@ TAO_ORB_Core::stub_factory (void) return this->stub_factory_; // If not, look in the service repository for an instance. - const ACE_CString &stub_factory_name = - TAO_ORB_Core_Static_Resources::instance ()->stub_factory_name_; + const char *stub_factory_name = + this->orb_params ()->stub_factory_name (); this->stub_factory_ = ACE_Dynamic_Service<TAO_Stub_Factory>::instance (this->configuration (), - ACE_TEXT_CHAR_TO_TCHAR (stub_factory_name.c_str())); + ACE_TEXT_CHAR_TO_TCHAR (stub_factory_name)); return this->stub_factory_; } -void -TAO_ORB_Core::set_poa_factory (const char *poa_factory_name, - const char *poa_factory_directive) -{ - TAO_ORB_Core_Static_Resources::instance ()->poa_factory_name_ = - poa_factory_name; - TAO_ORB_Core_Static_Resources::instance ()->poa_factory_directive_ = - poa_factory_directive; -} - -const ACE_CString & -TAO_ORB_Core::poa_factory_name (void) -{ - return TAO_ORB_Core_Static_Resources::instance ()->poa_factory_name_; -} - -void -TAO_ORB_Core::set_endpoint_selector_factory (const char *endpoint_selector_factory_name) -{ - TAO_ORB_Core_Static_Resources::instance ()->endpoint_selector_factory_name_ = - endpoint_selector_factory_name; -} - TAO_Endpoint_Selector_Factory * TAO_ORB_Core::endpoint_selector_factory (void) { @@ -1725,26 +1677,18 @@ TAO_ORB_Core::endpoint_selector_factory (void) return this->endpoint_selector_factory_; // If not, look in the service repository for an instance. - const ACE_CString &endpoint_selector_factory_name = - TAO_ORB_Core_Static_Resources::instance ()->endpoint_selector_factory_name_; + const char* endpoint_selector_factory_name = + this->orb_params ()->endpoint_selector_factory_name (); this->endpoint_selector_factory_ = ACE_Dynamic_Service<TAO_Endpoint_Selector_Factory>::instance (this->configuration (), - ACE_TEXT_CHAR_TO_TCHAR (endpoint_selector_factory_name.c_str())); + ACE_TEXT_CHAR_TO_TCHAR (endpoint_selector_factory_name)); return this->endpoint_selector_factory_; } void -TAO_ORB_Core::set_protocols_hooks (const char *protocols_hooks_name) -{ - // Is synchronization necessary? - TAO_ORB_Core_Static_Resources::instance ()->protocols_hooks_name_ = - protocols_hooks_name; -} - -void TAO_ORB_Core::set_network_priority_protocols_hooks ( const char *network_priority_protocols_hooks_name) { @@ -1867,18 +1811,18 @@ TAO_ORB_Core::root_poa (void) TAO_Adapter_Factory *factory = ACE_Dynamic_Service<TAO_Adapter_Factory>::instance (this->configuration (), - static_resources->poa_factory_name_.c_str()); + this->orb_params ()->poa_factory_name ()); if (factory == 0) { this->configuration()->process_directive ( ACE_TEXT_CHAR_TO_TCHAR ( - static_resources->poa_factory_directive_.c_str())); + this->orb_params ()->poa_factory_directive ())); factory = ACE_Dynamic_Service<TAO_Adapter_Factory>::instance (this->configuration (), - static_resources->poa_factory_name_.c_str()); + this->orb_params ()->poa_factory_name ()); } if (factory == 0) diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index b1fad823e9e..94ac1827a9c 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -298,17 +298,9 @@ public: //@} - /// Sets the value of - /// TAO_ORB_Core::thread_lane_resources_manager_factory_name_ - static void set_thread_lane_resources_manager_factory (const char * - thread_lane_resources_manager_factory_name); - /// Sets the value of TAO_ORB_Core::collocation_resolver_name_ static void set_collocation_resolver (const char *collocation_resolver_name); - /// Sets the value of TAO_ORB_Core::stub_factory_name_ - static void set_stub_factory (const char *stub_factory_name); - /// Sets the value of TAO_ORB_Core::resource_factory_ static void set_resource_factory (const char *resource_factory_name); @@ -319,25 +311,10 @@ public: */ static void set_gui_resource_factory (TAO::GUIResource_Factory *gui_factory); - /// Sets the value of TAO_ORB_Core::protocols_hooks_ - static void set_protocols_hooks (const char *protocols_hooks_name); - /// Sets the value of TAO_ORB_Core::network_priority_protocols_hooks_ static void set_network_priority_protocols_hooks ( const char *network_priority_protocols_hooks_name); - /// Sets the value of TAO_ORB_Core::endpoint_selector_factory_ - static void set_endpoint_selector_factory ( - const char *endpoint_selector_factory_name); - - /// Sets the name of the POA factory and the dynamic service - /// configurator directive to load it if needed. - static void set_poa_factory (const char *poa_factory_name, - const char *poa_factory_directive); - - /// Access the POA factory name. - static const ACE_CString &poa_factory_name (void); - /// Gets the value of TAO_ORB_Core::protocols_hooks__ TAO_Protocols_Hooks * get_protocols_hooks (void); @@ -1275,14 +1252,6 @@ public: TAO_ORB_Core::Sync_Scope_Hook sync_scope_hook_; /** - * Name of the protocols_hooks that needs to be instantiated. - * The default value is "Protocols_Hooks". If RTCORBA option is - * set, its value will be set to be "RT_Protocols_Hooks". - */ - ACE_CString protocols_hooks_name_; - - - /** * Name of the network_priority_protocols_hooks that needs to be instantiated. */ ACE_CString network_priority_protocols_hooks_name_; @@ -1294,24 +1263,6 @@ public: TAO_ORB_Core::Timeout_Hook connection_timeout_hook_; /** - * Name of the endpoint selector factory that needs to be instantiated. - * The default value is "Default_Endpoint_Selector_Factory". If - * TAO_RTCORBA is linked, the set_endpoint_selector_factory will be - * called to set the value to be "RT_Endpoint_Selector_Factory". - */ - ACE_CString endpoint_selector_factory_name_; - - /** - * Name of the thread lane resources manager that needs to be - * instantiated. The default value is - * "Default_Thread_Lane_Resources_Manager_Factory". If TAO_RTCORBA - * is linked, the set_thread_lane_resources_manager will be called - * to set the value to be - * "RT_Thread_Lane_Resources_Manager_Factory". - */ - ACE_CString thread_lane_resources_manager_factory_name_; - - /** * Name of the collocation resolver that needs to be instantiated. * The default value is "Default_Collocation_Resolver". If * TAO_RTCORBA is linked, the set_collocation_resolver will be @@ -1320,14 +1271,6 @@ public: ACE_CString collocation_resolver_name_; /** - * Name of the stub factory that needs to be instantiated. - * The default value is "Default_Stub_Factory". If TAO_RTCORBA is - * linked, the set_stub_factory will be called to set the value - * to be "RT_Stub_Factory". - */ - ACE_CString stub_factory_name_; - - /** * Name of the resource factory that needs to be instantiated. * The default value is "Resource_Factory". If TAO_Strategies is * linked, the set_resource_factory will be called to set the value @@ -1380,20 +1323,6 @@ public: */ ACE_CString valuetype_adapter_factory_name_; - /** - * Name of the service object used to create the RootPOA. The - * default value is "TAO_POA". If TAO_RTCORBA is loaded, this - * will be changed to TAO_RT_POA so that a POA equipped with - * realtime extensions will be returned. - */ - ACE_CString poa_factory_name_; - - /** - * The service configurator directive used to load - * poa_factory_name_ dynamically. - */ - ACE_CString poa_factory_directive_; - /// An alternative hook to be set for the ConnectionTimeoutPolicy TAO_ORB_Core::Timeout_Hook alt_connection_timeout_hook_; diff --git a/TAO/tao/PI/PolicyFactory_Registry.cpp b/TAO/tao/PI/PolicyFactory_Registry.cpp index b3788ff5b01..00fc855faec 100644 --- a/TAO/tao/PI/PolicyFactory_Registry.cpp +++ b/TAO/tao/PI/PolicyFactory_Registry.cpp @@ -58,7 +58,7 @@ TAO_PolicyFactory_Registry::register_policy_factory ( { // PolicyFactory of given type already exists. throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 16, - CORBA::COMPLETED_NO); + CORBA::COMPLETED_NO); } else { @@ -70,8 +70,7 @@ TAO_PolicyFactory_Registry::register_policy_factory ( CORBA::Policy_ptr TAO_PolicyFactory_Registry::create_policy (CORBA::PolicyType type, - const CORBA::Any &value - ) + const CORBA::Any &value) { PortableInterceptor::PolicyFactory_ptr policy_factory = PortableInterceptor::PolicyFactory::_nil (); diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index 32b5513fe66..0635d7ffbae 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -242,8 +242,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ } void -TAO_Object_Adapter::init_default_policies (TAO_POA_Policy_Set &policies - ) +TAO_Object_Adapter::init_default_policies (TAO_POA_Policy_Set &policies) { // Initialize the default policies. #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp index 90d7614d6d8..c10742988a1 100644 --- a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp +++ b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp @@ -68,25 +68,29 @@ TAO_RT_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr info) // Register all of the RT related services. // + // Narrow to a TAO_ORBInitInfo object to get access to the + // orb_core() TAO extension. + TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info); + // Set the name of the Protocol_Hooks to be RT_Protocols_Hooks. - TAO_ORB_Core::set_protocols_hooks ("RT_Protocols_Hooks"); + tao_info->orb_core ()->orb_params ()->protocols_hooks_name ("RT_Protocols_Hooks"); ACE_Service_Config::process_directive (ace_svc_desc_TAO_RT_Protocols_Hooks); // Set the name of the stub factory to be RT_Stub_Factory. - TAO_ORB_Core::set_stub_factory ("RT_Stub_Factory"); + tao_info->orb_core ()->orb_params ()->stub_factory_name ("RT_Stub_Factory"); ACE_Service_Config::process_directive (ace_svc_desc_TAO_RT_Stub_Factory); // Set the name of the stub factory to be RT_Stub_Factory. - TAO_ORB_Core::set_endpoint_selector_factory ("RT_Endpoint_Selector_Factory"); + tao_info->orb_core ()->orb_params ()->endpoint_selector_factory_name ("RT_Endpoint_Selector_Factory"); ACE_Service_Config::process_directive (ace_svc_desc_RT_Endpoint_Selector_Factory); // Set the name of the thread lane resources manager to be RT_Thread_Lane_Resources_Manager. - TAO_ORB_Core::set_thread_lane_resources_manager_factory ("RT_Thread_Lane_Resources_Manager_Factory"); + tao_info->orb_core ()->orb_params ()->thread_lane_resources_manager_factory_name ("RT_Thread_Lane_Resources_Manager_Factory"); ACE_Service_Config::process_directive (ace_svc_desc_TAO_RT_Thread_Lane_Resources_Manager_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, - ACE_TEXT_ALWAYS_CHAR (rt_poa_factory_directive)); + tao_info->orb_core ()->orb_params ()->poa_factory_name (rt_poa_factory_name); + tao_info->orb_core ()->orb_params ()->poa_factory_directive (ACE_TEXT_ALWAYS_CHAR (rt_poa_factory_directive)); // Create the initial priority mapping instance. TAO_Priority_Mapping *pm = 0; @@ -155,10 +159,6 @@ TAO_RT_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr info) info->register_initial_reference ("NetworkPriorityMappingManager", network_manager); - // Narrow to a TAO_ORBInitInfo object to get access to the - // orb_core() TAO extension. - TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info); - if (CORBA::is_nil (tao_info.in ())) { if (TAO_debug_level > 0) diff --git a/TAO/tao/Strategies.mpc b/TAO/tao/Strategies.mpc index 7a7b467f180..76f08d1943d 100644 --- a/TAO/tao/Strategies.mpc +++ b/TAO/tao/Strategies.mpc @@ -1,6 +1,6 @@ //$Id$ -project : taolib, install, core_anytypecode, core_strategies, tao_versioning_idl_defaults { +project : taolib, install, pi, core_anytypecode, core_strategies, tao_versioning_idl_defaults { sharedname = TAO_Strategies dynamicflags = TAO_STRATEGIES_BUILD_DLL diff --git a/TAO/tao/Strategies/OC_Endpoint_Selector_Factory.cpp b/TAO/tao/Strategies/OC_Endpoint_Selector_Factory.cpp index eecb8e70779..6dec01899b6 100644 --- a/TAO/tao/Strategies/OC_Endpoint_Selector_Factory.cpp +++ b/TAO/tao/Strategies/OC_Endpoint_Selector_Factory.cpp @@ -2,6 +2,9 @@ #include "tao/Strategies/OC_Endpoint_Selector_Factory.h" #include "tao/Strategies/Optimized_Connection_Endpoint_Selector.h" +#include "tao/Strategies/Strategies_ORBInitializer.h" +#include "tao/ORBInitializer_Registry.h" +#include "tao/PI/ORBInitInfo.h" #include "ace/Log_Msg.h" #include "tao/ORB_Core.h" #include "ace/OS.h" @@ -27,7 +30,6 @@ TAO_OC_Endpoint_Selector_Factory::init (int argc, ACE_TCHAR *argv[]) { ACE_Time_Value timeout(0,0); - TAO_ORB_Core::set_endpoint_selector_factory ("OC_Endpoint_Selector_Factory"); for (int count = 0; count < argc; count++) { if ((ACE_OS::strcasecmp (argv[count], @@ -40,12 +42,48 @@ TAO_OC_Endpoint_Selector_Factory::init (int argc, ACE_TCHAR *argv[]) } } + if (this->register_orb_initializer () == -1) + return -1; + ACE_NEW_RETURN (this->oc_endpoint_selector_, TAO_Optimized_Connection_Endpoint_Selector(timeout), -1); return 0; } +int +TAO_OC_Endpoint_Selector_Factory::register_orb_initializer (void) +{ + // Register the ORB initializer. + try + { + PortableInterceptor::ORBInitializer_ptr temp_orb_initializer = + PortableInterceptor::ORBInitializer::_nil (); + + /// Register the RTCORBA ORBInitializer. + ACE_NEW_THROW_EX (temp_orb_initializer, + TAO_Strategies_ORBInitializer, + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + TAO::VMCID, + ENOMEM), + CORBA::COMPLETED_NO)); + + PortableInterceptor::ORBInitializer_var orb_initializer; + orb_initializer = temp_orb_initializer; + + PortableInterceptor::register_orb_initializer (orb_initializer.in ()); + } + catch (const ::CORBA::Exception& ex) + { + ex._tao_print_exception ( + "Unexpected exception caught while " + "initializing the Strategies library"); + return -1; + } + + return 0; +} TAO_Invocation_Endpoint_Selector * TAO_OC_Endpoint_Selector_Factory::get_selector (void) diff --git a/TAO/tao/Strategies/OC_Endpoint_Selector_Factory.h b/TAO/tao/Strategies/OC_Endpoint_Selector_Factory.h index de45e4fdc5e..d5e25dca8d6 100644 --- a/TAO/tao/Strategies/OC_Endpoint_Selector_Factory.h +++ b/TAO/tao/Strategies/OC_Endpoint_Selector_Factory.h @@ -61,7 +61,6 @@ public: /// Destructor. virtual ~TAO_OC_Endpoint_Selector_Factory (void); - virtual int init (int argc, ACE_TCHAR *argv[]); /// Get an Invocation's endpoint selection strategy and @@ -73,6 +72,8 @@ protected: /// returned by this factory TAO_Optimized_Connection_Endpoint_Selector *oc_endpoint_selector_; + + int register_orb_initializer (void); }; diff --git a/TAO/tao/Strategies/Strategies_ORBInitializer.cpp b/TAO/tao/Strategies/Strategies_ORBInitializer.cpp new file mode 100644 index 00000000000..6aa63c6b810 --- /dev/null +++ b/TAO/tao/Strategies/Strategies_ORBInitializer.cpp @@ -0,0 +1,43 @@ +#include "tao/Strategies/Strategies_ORBInitializer.h" + +ACE_RCSID (Strategies, + Strategies_ORBInitializer, + "$Id$") + +#include "tao/Exception.h" +#include "tao/ORB_Core.h" +#include "tao/PI/ORBInitInfo.h" +#include "tao/debug.h" + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +void +TAO_Strategies_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr info) +{ + // Narrow to a TAO_ORBInitInfo object to get access to the + // orb_core() TAO extension. + TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info); + + if (CORBA::is_nil (tao_info.in ())) + { + if (TAO_debug_level > 0) + ACE_ERROR ((LM_ERROR, + "(%P|%t) TAO_Strategies_ORBInitializer::pre_init:\n" + "(%P|%t) Unable to narrow " + "\"PortableInterceptor::ORBInitInfo_ptr\" to\n" + "(%P|%t) \"TAO_ORBInitInfo *.\"\n")); + + throw ::CORBA::INTERNAL (); + } + + // Make sure we get the correct endpoint selector + tao_info->orb_core ()->orb_params ()->endpoint_selector_factory_name ("OC_Endpoint_Selector_Factory"); +} + +void +TAO_Strategies_ORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr) +{ +} + +TAO_END_VERSIONED_NAMESPACE_DECL + diff --git a/TAO/tao/Strategies/Strategies_ORBInitializer.h b/TAO/tao/Strategies/Strategies_ORBInitializer.h new file mode 100644 index 00000000000..e7267eddefd --- /dev/null +++ b/TAO/tao/Strategies/Strategies_ORBInitializer.h @@ -0,0 +1,57 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Strategies_ORBInitializer.h + * + * $Id$ + * + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + + +#ifndef TAO_STRATEGIES_ORB_INITIALIZER_H +#define TAO_STRATEGIES_ORB_INITIALIZER_H + +#include /**/ "ace/pre.h" + +#include "tao/orbconf.h" + +#include "tao/Strategies/strategies_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PI/PI.h" +#include "tao/LocalObject.h" + +// This is to remove "inherits via dominance" warnings from MSVC. +// MSVC is being a little too paranoid. +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +class TAO_Strategies_ORBInitializer + : public virtual PortableInterceptor::ORBInitializer + , public virtual TAO_Local_RefCounted_Object +{ +public: + virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info); + + virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info); +}; + +TAO_END_VERSIONED_NAMESPACE_DECL + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#include /**/ "ace/post.h" + +#endif /* TAO_STRATEGIES_ORB_INITIALIZER_H */ diff --git a/TAO/tao/TAO_Internal.cpp b/TAO/tao/TAO_Internal.cpp index 8093f963756..4f240db2ce6 100644 --- a/TAO/tao/TAO_Internal.cpp +++ b/TAO/tao/TAO_Internal.cpp @@ -451,7 +451,7 @@ namespace #endif /* TAO_PLATFORM_SVC_CONF_FILE_NOTSUP */ // Copy command line parameter to allow conversion - ACE_Argv_Type_Converter command_line (argc, argv); + ACE_Argv_Type_Converter command_line (argc, argv); return pcfg->open (command_line.get_argc (), command_line.get_TCHAR_argv (), @@ -573,17 +573,6 @@ namespace (ACE_TEXT_CHAR_TO_TCHAR (server_strategy_factory_args)); } - // If available, allow the Adapter Factory to setup. - ACE_Service_Object *adapter_factory = - ACE_Dynamic_Service<ACE_Service_Object>::instance ( - pcfg, - TAO_ORB_Core::poa_factory_name ().c_str ()); - - if (adapter_factory != 0) - { - adapter_factory->init (0, 0); - } - ACE_Service_Object * const pi_server_loader = ACE_Dynamic_Service<ACE_Service_Object>::instance ( pcfg, diff --git a/TAO/tao/Valuetype/ValueFactory_Map.cpp b/TAO/tao/Valuetype/ValueFactory_Map.cpp index 9100f319cf8..42269201b10 100644 --- a/TAO/tao/Valuetype/ValueFactory_Map.cpp +++ b/TAO/tao/Valuetype/ValueFactory_Map.cpp @@ -1,8 +1,6 @@ #include "tao/Valuetype/ValueFactory_Map.h" #include "tao/Valuetype/ValueFactory.h" #include "tao/CORBA_String.h" -#include "tao/TAO_Singleton.h" - ACE_RCSID (Valuetype, ValueFactory_Map, diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp index e3a9c6e3154..6b60655885d 100644 --- a/TAO/tao/params.cpp +++ b/TAO/tao/params.cpp @@ -8,7 +8,7 @@ #endif /* __ACE_INLINE__ */ #include "ace/OS_NS_Thread.h" - +#include "ace/Service_Config.h" ACE_RCSID (tao, params, @@ -49,6 +49,17 @@ TAO_ORB_Parameters::TAO_ORB_Parameters (void) #endif /* ACE_HAS_IPV6 */ , negotiate_codesets_ (true) , ami_collication_ (true) + , protocols_hooks_name_ ("Protocols_Hooks") + , endpoint_selector_factory_name_ ("Default_Endpoint_Selector_Factory") + , thread_lane_resources_manager_factory_name_ ("Default_Thread_Lane_Resources_Manager_Factory") + , stub_factory_name_ ("Default_Stub_Factory") + , poa_factory_name_ ("TAO_Object_Adapter_Factory") + , poa_factory_directive_ + (ACE_TEXT_ALWAYS_CHAR + (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Object_Adapter_Factory", + "TAO_PortableServer", + "_make_TAO_Object_Adapter_Factory", + ""))) { for (int i = 0; i != TAO_NO_OF_MCAST_SERVICES; ++i) { @@ -323,4 +334,76 @@ TAO_ORB_Parameters::use_ipv6_link_local (void) const } #endif /* ACE_HAS_IPV6 */ +void +TAO_ORB_Parameters::protocols_hooks_name (const char *s) +{ + this->protocols_hooks_name_ = s; +} + +const char * +TAO_ORB_Parameters::protocols_hooks_name (void) const +{ + return this->protocols_hooks_name_.c_str (); +} + +void +TAO_ORB_Parameters::thread_lane_resources_manager_factory_name (const char *s) +{ + this->thread_lane_resources_manager_factory_name_ = s; +} + +const char * +TAO_ORB_Parameters::thread_lane_resources_manager_factory_name (void) const +{ + return this->thread_lane_resources_manager_factory_name_.c_str (); +} + +void +TAO_ORB_Parameters::stub_factory_name (const char *s) +{ + this->stub_factory_name_ = s; +} + +const char * +TAO_ORB_Parameters::stub_factory_name (void) const +{ + return this->stub_factory_name_.c_str (); +} + +void +TAO_ORB_Parameters::poa_factory_name (const char *s) +{ + this->poa_factory_name_ = s; +} + +const char * +TAO_ORB_Parameters::poa_factory_name (void) const +{ + return this->poa_factory_name_.c_str (); +} + +void +TAO_ORB_Parameters::poa_factory_directive (const char *s) +{ + this->poa_factory_directive_ = s; +} + +const char * +TAO_ORB_Parameters::poa_factory_directive (void) const +{ + return this->poa_factory_directive_.c_str (); +} + +void +TAO_ORB_Parameters::endpoint_selector_factory_name (const char *s) +{ + this->endpoint_selector_factory_name_ = s; +} + +const char * +TAO_ORB_Parameters::endpoint_selector_factory_name (void) const +{ + return this->endpoint_selector_factory_name_.c_str (); +} + TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/params.h b/TAO/tao/params.h index 5cbf9bc23b0..3c9f3ca79f6 100644 --- a/TAO/tao/params.h +++ b/TAO/tao/params.h @@ -218,6 +218,24 @@ public: void ami_collication (bool opt); bool ami_collication (void) const; + void protocols_hooks_name (const char *s); + const char *protocols_hooks_name (void) const; + + void thread_lane_resources_manager_factory_name (const char *s); + const char *thread_lane_resources_manager_factory_name (void) const; + + void stub_factory_name (const char *s); + const char *stub_factory_name (void) const; + + void poa_factory_name (const char *s); + const char *poa_factory_name (void) const; + + void poa_factory_directive (const char *s); + const char *poa_factory_directive (void) const; + + void endpoint_selector_factory_name (const char *s); + const char *endpoint_selector_factory_name (void) const; + private: // Each "endpoint" is of the form: // @@ -374,6 +392,53 @@ private: /// Do we make collocated ami calls bool ami_collication_; + + /** + * Name of the protocols_hooks that needs to be instantiated. + * The default value is "Protocols_Hooks". If RTCORBA option is + * set, its value will be set to be "RT_Protocols_Hooks". + */ + ACE_CString protocols_hooks_name_; + + /** + * Name of the stub factory that needs to be instantiated. + * The default value is "Default_Stub_Factory". If TAO_RTCORBA is + * linked, the set_stub_factory will be called to set the value + * to be "RT_Stub_Factory". + */ + ACE_CString stub_factory_name_; + + /** + * Name of the endpoint selector factory that needs to be instantiated. + * The default value is "Default_Endpoint_Selector_Factory". If + * TAO_RTCORBA is linked, the set_endpoint_selector_factory will be + * called to set the value to be "RT_Endpoint_Selector_Factory". + */ + ACE_CString endpoint_selector_factory_name_; + + /** + * Name of the thread lane resources manager that needs to be + * instantiated. The default value is + * "Default_Thread_Lane_Resources_Manager_Factory". If TAO_RTCORBA + * is linked, the set_thread_lane_resources_manager will be called + * to set the value to be + * "RT_Thread_Lane_Resources_Manager_Factory". + */ + ACE_CString thread_lane_resources_manager_factory_name_; + + /** + * Name of the service object used to create the RootPOA. The + * default value is "TAO_POA". If TAO_RTCORBA is loaded, this + * will be changed to TAO_RT_POA so that a POA equipped with + * realtime extensions will be returned. + */ + ACE_CString poa_factory_name_; + + /** + * The service configurator directive used to load + * poa_factory_name_ dynamically. + */ + ACE_CString poa_factory_directive_; }; TAO_END_VERSIONED_NAMESPACE_DECL |