summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-01-29 17:55:31 +0000
committerfhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-01-29 17:55:31 +0000
commitf39b8aaf77f388428431f5efe1a0425b22501c70 (patch)
tree29999c0e91a325773539d19cadf0b7fec25404ac
parentfaa1c242f48695f67132c775031f89140d2b8901 (diff)
downloadATCD-f39b8aaf77f388428431f5efe1a0425b22501c70.tar.gz
ChangeLogTag: Wed Jan 29 12:43:06 2003 Frank Hunleth <frank@hunleth.com>
-rw-r--r--TAO/ChangeLog27
-rw-r--r--TAO/tao/ORB_Core.cpp161
-rw-r--r--TAO/tao/ORB_Core.h193
3 files changed, 236 insertions, 145 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 3a14745b502..9fc35d5853f 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,17 +1,32 @@
+Wed Jan 29 12:43:06 2003 Frank Hunleth <frank@hunleth.com>
+
+ * tao/ORB_Core.{cpp,h}: Encapsulated all static members of
+ TAO_ORB_Core into a TAO_ORB_Core_Static_Resources singleton. By
+ accessing all of these variables through the singleton, this
+ alleviates the constructor call ordering problem inwhich
+ constructors in other compliation units (a.k.a some TAO shared
+ libraries) are called before those in TAO_ORB_Core and modify
+ the TAO_ORB_Core static variables before they are constructed.
+ This caused segfaults when it happened, and seemed to affect
+ OpenBSD the most.
+
+ Note that this change is selfcontained and does not affect any
+ other classes.
+
Wed Jan 29 12:15:31 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
* tests/Bug_1361_Regression/run_test.pl: Reduced the number of
iterations that this test runs. Removed -ORBdebuglevel from teh
scripts. This was used for debugging purposes long back.
-
+
* tests/Bug_1361_Regression/Server_Thread_Pool.cpp: Removed a
debug statement where we print exceptions. This is expected in
this test.
Tue Jan 28 15:59:45 2003 Priyanka Gontla <pgontla@ece.uci.edu>
- * docs/Options.html:
- Added documentation on support to ORBListenEndpoints, ORBId and
+ * docs/Options.html:
+ Added documentation on support to ORBListenEndpoints, ORBId and
ORBServerId ORB options.
Tue Jan 28 16:07:21 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
@@ -20,7 +35,7 @@ Tue Jan 28 16:07:21 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_visitor_interface/interface_ch.cpp:
* TAO_IDL/be_include/be_interface.h:
- Delayed the check for abstract interfaces in the
+ Delayed the check for abstract interfaces in the
ancestry of a non-abstract interface until just before
the knowledge is needed for the first time in code
generation. This corrects a problem with forward
@@ -36,8 +51,8 @@ Tue Jan 28 14:27:01 2003 Pradeep Gore <pradeep@oomworks.com>
reactive concurrency. This fixes the problem of the Notify
crashing without any conf. file. Thanks to Dennis Sporcic
<dennis@hsa.com.au> and Frederic Langlet
- <Frederic.Langlet@alcatel.com> for reporting this problem.
-
+ <Frederic.Langlet@alcatel.com> for reporting this problem.
+
Mon Jan 27 23:01:43 2003 Frank Hunleth <frank@hunleth.com>
* orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp: Fixed code
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 5dda244d238..391f9741078 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -74,32 +74,54 @@ TAO_default_environment ()
// ****************************************************************
-TAO_ORB_Core::Timeout_Hook TAO_ORB_Core::timeout_hook_ = 0;
-TAO_ORB_Core::Timeout_Hook TAO_ORB_Core::connection_timeout_hook_ = 0;
-TAO_ORB_Core::Sync_Scope_Hook TAO_ORB_Core::sync_scope_hook_ = 0;
-
-ACE_CString TAO_ORB_Core::endpoint_selector_factory_name_ =
- "Default_Endpoint_Selector_Factory";
-ACE_CString TAO_ORB_Core::thread_lane_resources_manager_factory_name_ =
- "Default_Thread_Lane_Resources_Manager_Factory";
-ACE_CString TAO_ORB_Core::collocation_resolver_name_ =
- "Default_Collocation_Resolver";
-ACE_CString TAO_ORB_Core::stub_factory_name_ =
- "Default_Stub_Factory";
-ACE_CString TAO_ORB_Core::resource_factory_name_ =
- "Resource_Factory";
-ACE_CString TAO_ORB_Core::protocols_hooks_name_ =
- "Protocols_Hooks";
-ACE_CString TAO_ORB_Core::dynamic_adapter_name_ =
- "Dynamic_Adapter";
-ACE_CString TAO_ORB_Core::ifr_client_adapter_name_ =
- "IFR_Client_Adapter";
-ACE_CString TAO_ORB_Core::typecodefactory_adapter_name_ =
- "TypeCodeFactory_Adapter";
-ACE_CString TAO_ORB_Core::poa_factory_name_ =
- "TAO_POA";
-ACE_CString TAO_ORB_Core::poa_factory_directive_ =
- "dynamic TAO_POA Service_Object * TAO_PortableServer:_make_TAO_Object_Adapter_Factory()";
+// Initialize instance_ to 0, since this is what we test for in the call
+// to instance (). Note that this does not require a constructor call, so
+// it is always initialized by the time that instance () can be called.
+TAO_ORB_Core_Static_Resources* TAO_ORB_Core_Static_Resources::instance_ = 0;
+
+// Force an instance to be created at module initialization time,
+// since we do not want to worry about double checked locking and
+// the race condition to initialize the lock.
+TAO_ORB_Core_Static_Resources* TAO_ORB_Core_Static_Resources::initialization_reference_ =
+ TAO_ORB_Core_Static_Resources::instance ();
+
+TAO_ORB_Core_Static_Resources*
+TAO_ORB_Core_Static_Resources::instance (void)
+{
+ if (TAO_ORB_Core_Static_Resources::instance_ == 0)
+ {
+ // This new is never freed on purpose. The data specified by
+ // it needs to be around for the last shared library that references
+ // this class. This could occur in a destructor in a shared library
+ // that is unloaded after this one. One solution to avoid this
+ // harmless memory leak would be to use reference counting.
+ ACE_NEW_RETURN (TAO_ORB_Core_Static_Resources::instance_,
+ TAO_ORB_Core_Static_Resources (),
+ 0);
+ }
+
+ return TAO_ORB_Core_Static_Resources::instance_;
+}
+
+TAO_ORB_Core_Static_Resources::TAO_ORB_Core_Static_Resources (void)
+ : sync_scope_hook_ (0),
+ protocols_hooks_name_ ("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"),
+ poa_factory_name_ ("TAO_POA"),
+ poa_factory_directive_ ("dynamic TAO_POA Service_Object * TAO_PortableServer:_make_TAO_Object_Adapter_Factory()")
+{
+}
+
+// ****************************************************************
TAO_ORB_Core::TAO_ORB_Core (const char *orbid)
: protocols_hooks_ (0),
@@ -1122,63 +1144,65 @@ 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::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::collocation_resolver_name_ =
+ TAO_ORB_Core_Static_Resources::instance ()->collocation_resolver_name_ =
collocation_resolver_name;
}
void
TAO_ORB_Core::set_stub_factory (const char *stub_factory_name)
{
- TAO_ORB_Core::stub_factory_name_ = 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::resource_factory_name_ = resource_factory_name;
+ TAO_ORB_Core_Static_Resources::instance ()->resource_factory_name_ =
+ resource_factory_name;
}
void
TAO_ORB_Core::dynamic_adapter_name (const char *name)
{
- TAO_ORB_Core::dynamic_adapter_name_ = name;
+ TAO_ORB_Core_Static_Resources::instance ()->dynamic_adapter_name_ = name;
}
const char *
TAO_ORB_Core::dynamic_adapter_name (void)
{
- return TAO_ORB_Core::dynamic_adapter_name_.c_str();
+ return TAO_ORB_Core_Static_Resources::instance ()->dynamic_adapter_name_.c_str();
}
void
TAO_ORB_Core::ifr_client_adapter_name (const char *name)
{
- TAO_ORB_Core::ifr_client_adapter_name_ = name;
+ TAO_ORB_Core_Static_Resources::instance ()->ifr_client_adapter_name_ = name;
}
const char *
TAO_ORB_Core::ifr_client_adapter_name (void)
{
- return TAO_ORB_Core::ifr_client_adapter_name_.c_str();
+ return TAO_ORB_Core_Static_Resources::instance ()->ifr_client_adapter_name_.c_str();
}
void
TAO_ORB_Core::typecodefactory_adapter_name (const char *name)
{
- TAO_ORB_Core::typecodefactory_adapter_name_ = name;
+ TAO_ORB_Core_Static_Resources::instance ()->typecodefactory_adapter_name_ = name;
}
const char *
TAO_ORB_Core::typecodefactory_adapter_name (void)
{
- return TAO_ORB_Core::typecodefactory_adapter_name_.c_str();
+ return TAO_ORB_Core_Static_Resources::instance ()->typecodefactory_adapter_name_.c_str();
}
TAO_Resource_Factory *
@@ -1191,7 +1215,7 @@ TAO_ORB_Core::resource_factory (void)
// Look in the service repository for an instance.
this->resource_factory_ =
ACE_Dynamic_Service<TAO_Resource_Factory>::instance
- (TAO_ORB_Core::resource_factory_name_.c_str());
+ (TAO_ORB_Core_Static_Resources::instance ()->resource_factory_name_.c_str());
return this->resource_factory_;
}
@@ -1206,7 +1230,7 @@ TAO_ORB_Core::thread_lane_resources_manager (void)
// If not, lookup the corresponding factory and ask it to make one.
TAO_Thread_Lane_Resources_Manager_Factory *factory =
ACE_Dynamic_Service<TAO_Thread_Lane_Resources_Manager_Factory>::instance
- (TAO_ORB_Core::thread_lane_resources_manager_factory_name_.c_str());
+ (TAO_ORB_Core_Static_Resources::instance ()->thread_lane_resources_manager_factory_name_.c_str());
this->thread_lane_resources_manager_ =
factory->create_thread_lane_resources_manager (*this);
@@ -1224,7 +1248,7 @@ TAO_ORB_Core::collocation_resolver (void)
// If not, lookup it up.
this->collocation_resolver_ =
ACE_Dynamic_Service<TAO_Collocation_Resolver>::instance
- (TAO_ORB_Core::collocation_resolver_name_.c_str());
+ (TAO_ORB_Core_Static_Resources::instance ()->collocation_resolver_name_.c_str());
return *this->collocation_resolver_;
}
@@ -1239,7 +1263,7 @@ TAO_ORB_Core::stub_factory (void)
// If not, look in the service repository for an instance.
this->stub_factory_ =
ACE_Dynamic_Service<TAO_Stub_Factory>::instance
- (TAO_ORB_Core::stub_factory_name_.c_str());
+ (TAO_ORB_Core_Static_Resources::instance ()->stub_factory_name_.c_str());
return this->stub_factory_;
}
@@ -1248,20 +1272,22 @@ void
TAO_ORB_Core::set_poa_factory (const char *poa_factory_name,
const char *poa_factory_directive)
{
- TAO_ORB_Core::poa_factory_name_ = poa_factory_name;
- TAO_ORB_Core::poa_factory_directive_ = 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::poa_factory_name_;
+ 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::endpoint_selector_factory_name_ =
+ TAO_ORB_Core_Static_Resources::instance ()->endpoint_selector_factory_name_ =
endpoint_selector_factory_name;
}
@@ -1275,15 +1301,16 @@ TAO_ORB_Core::endpoint_selector_factory (void)
// If not, look in the service repository for an instance.
this->endpoint_selector_factory_ =
ACE_Dynamic_Service<TAO_Endpoint_Selector_Factory>::instance
- (TAO_ORB_Core::endpoint_selector_factory_name_.c_str());
+ (TAO_ORB_Core_Static_Resources::instance ()->endpoint_selector_factory_name_.c_str());
return this->endpoint_selector_factory_;
}
void
-TAO_ORB_Core::set_protocols_hooks (const char *protocols_hooks)
+TAO_ORB_Core::set_protocols_hooks (const char *protocols_hooks_name)
{
- TAO_ORB_Core::protocols_hooks_name_ = protocols_hooks;
+ TAO_ORB_Core_Static_Resources::instance ()->protocols_hooks_name_ =
+ protocols_hooks_name;
}
TAO_Protocols_Hooks *
@@ -1296,7 +1323,7 @@ TAO_ORB_Core::get_protocols_hooks (ACE_ENV_SINGLE_ARG_DECL)
// If not, look in the service repository for an instance.
this->protocols_hooks_ =
ACE_Dynamic_Service<TAO_Protocols_Hooks>::instance
- (TAO_ORB_Core::protocols_hooks_name_.c_str());
+ (TAO_ORB_Core_Static_Resources::instance ()->protocols_hooks_name_.c_str());
// Initialize the protocols hooks instance.
this->protocols_hooks_->init_hooks (this
@@ -1458,13 +1485,15 @@ TAO_ORB_Core::root_poa (ACE_ENV_SINGLE_ARG_DECL)
if (!CORBA::is_nil (this->root_poa_.in ()))
return CORBA::Object::_duplicate (this->root_poa_.in ());
+ TAO_ORB_Core_Static_Resources* static_resources =
+ TAO_ORB_Core_Static_Resources::instance ();
TAO_Adapter_Factory *factory =
- ACE_Dynamic_Service<TAO_Adapter_Factory>::instance (TAO_ORB_Core::poa_factory_name_.c_str());
+ ACE_Dynamic_Service<TAO_Adapter_Factory>::instance (static_resources->poa_factory_name_.c_str());
if (factory == 0)
{
- ACE_Service_Config::process_directive (ACE_TEXT_CHAR_TO_TCHAR(TAO_ORB_Core::poa_factory_directive_.c_str()));
+ ACE_Service_Config::process_directive (ACE_TEXT_CHAR_TO_TCHAR(static_resources->poa_factory_directive_.c_str()));
factory =
- ACE_Dynamic_Service<TAO_Adapter_Factory>::instance (TAO_ORB_Core::poa_factory_name_.c_str());
+ ACE_Dynamic_Service<TAO_Adapter_Factory>::instance (static_resources->poa_factory_name_.c_str());
}
if (factory == 0)
@@ -2446,13 +2475,16 @@ TAO_ORB_Core::call_sync_scope_hook (TAO_Stub *stub,
int &has_synchronization,
Messaging::SyncScope &scope)
{
- if (TAO_ORB_Core::sync_scope_hook_ == 0)
+ Sync_Scope_Hook sync_scope_hook =
+ TAO_ORB_Core_Static_Resources::instance ()->sync_scope_hook_;
+
+ if (sync_scope_hook == 0)
{
has_synchronization = 0;
return;
}
- (*TAO_ORB_Core::sync_scope_hook_) (this, stub, has_synchronization, scope);
+ (*sync_scope_hook) (this, stub, has_synchronization, scope);
}
TAO_Sync_Strategy &
@@ -2482,8 +2514,7 @@ TAO_ORB_Core::get_sync_strategy (TAO_Stub *,
void
TAO_ORB_Core::set_sync_scope_hook (Sync_Scope_Hook hook)
{
- TAO_ORB_Core::sync_scope_hook_ = hook;
- return;
+ TAO_ORB_Core_Static_Resources::instance ()-> sync_scope_hook_ = hook;
}
#if (TAO_HAS_SYNC_SCOPE_POLICY == 1)
@@ -2524,18 +2555,21 @@ TAO_ORB_Core::call_timeout_hook (TAO_Stub *stub,
int &has_timeout,
ACE_Time_Value &time_value)
{
- if (TAO_ORB_Core::timeout_hook_ == 0)
+ Timeout_Hook timeout_hook =
+ TAO_ORB_Core_Static_Resources::instance ()->timeout_hook_;
+
+ if (timeout_hook == 0)
{
has_timeout = 0;
return;
}
- (*TAO_ORB_Core::timeout_hook_) (this, stub, has_timeout, time_value);
+ (*timeout_hook) (this, stub, has_timeout, time_value);
}
void
TAO_ORB_Core::set_timeout_hook (Timeout_Hook hook)
{
- TAO_ORB_Core::timeout_hook_ = hook;
+ TAO_ORB_Core_Static_Resources::instance ()->timeout_hook_ = hook;
// Saving the hook pointer so that we can use it later when needed.
return;
@@ -2583,21 +2617,22 @@ TAO_ORB_Core::connection_timeout (TAO_Stub *stub,
int &has_timeout,
ACE_Time_Value &time_value)
{
- if (TAO_ORB_Core::connection_timeout_hook_ == 0)
+ Timeout_Hook connection_timeout_hook =
+ TAO_ORB_Core_Static_Resources::instance ()->connection_timeout_hook_;
+
+ if (connection_timeout_hook == 0)
{
has_timeout = 0;
return;
}
- (*TAO_ORB_Core::connection_timeout_hook_) (this, stub, has_timeout, time_value);
+ (*connection_timeout_hook) (this, stub, has_timeout, time_value);
}
void
TAO_ORB_Core::connection_timeout_hook (Timeout_Hook hook)
{
// Saving the hook pointer so that we can use it later when needed.
- TAO_ORB_Core::connection_timeout_hook_ = hook;
-
- return;
+ TAO_ORB_Core_Static_Resources::instance ()->connection_timeout_hook_ = hook;
}
CORBA::Policy_ptr
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index a3f668d84c7..ce42819ee21 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -612,9 +612,6 @@ public:
CORBA::Policy_ptr stubless_sync_scope (void);
#endif /* TAO_HAS_SYNC_SCOPE_POLICY == 1 */
- static Sync_Scope_Hook sync_scope_hook_;
- // The hook to be set for the SyncScopePolicy
-
#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
CORBA::Policy_ptr default_buffering_constraint (void) const;
@@ -633,12 +630,6 @@ public:
/// Handle to the factory for protocols_hooks_..
TAO_Protocols_Hooks *protocols_hooks_;
- // 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".
- static ACE_CString protocols_hooks_name_;
-
/// Obtain the TSS resources of this orb.
TAO_ORB_Core_TSS_Resources* get_tss_resources (void);
@@ -1010,12 +1001,6 @@ private:
TAO_ORB_Core *other_orb,
const TAO_MProfile &mprofile);
- /// The hook to be set for the RelativeRoundtripTimeoutPolicy.
- static Timeout_Hook timeout_hook_;
-
- /// The hook to be set for the ConnectionTimeoutPolicy
- static Timeout_Hook connection_timeout_hook_;
-
protected:
/// Synchronize internal state...
@@ -1100,69 +1085,8 @@ protected:
//@}
#endif /*if 0*/
- // 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".
- static 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".
- static ACE_CString thread_lane_resources_manager_factory_name_;
-
-
/// The server_id_ that was passed via -ORBServerId option
ACE_CString server_id_;
- // 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
- // called to set the value to be "RT_Collocation_Resolver".
- static 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".
- static 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
- // to be "Advanced_Resource_Factory".
- static ACE_CString resource_factory_name_;
-
- // Name of the service object for DII request creation that needs
- // to be instantiated. The default value is "Dynamic_Adaper". If
- // TAO_DynamicInterface is linked, dynamic_adapter_name() will be
- // called to set the value to "Concrete_Dynamic_Adapter".
- static ACE_CString dynamic_adapter_name_;
-
- // Name of the service object for functions that make calls on
- // the Interface Repository. The default value is "IFR_Client_Adaper".
- // If TAO_IFR_CLient is linked, ifr_client_adapter_name() will be
- // called to set the value to "Concrete_IFR_Client_Adapter".
- static ACE_CString ifr_client_adapter_name_;
-
- // Name of the service object used by the ORB create_*_tc functions.
- // The default value is "TypeCodeFactory_Adapter". If the
- // TypeCodeFactory library is linked, the corresponding accessor
- // function typecodefactory_adapter_name() will be called to set
- // the value to "Concrete_TypeCodeFactory_Adapter".
- static ACE_CString typecodefactory_adapter_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.
- static ACE_CString poa_factory_name_;
-
- // The service configurator directive used to load
- // poa_factory_name_ dynamically.
- static ACE_CString poa_factory_directive_;
/// Handle to the factory for Client-side strategies.
TAO_Client_Strategy_Factory *client_factory_;
@@ -1321,6 +1245,123 @@ protected:
// ****************************************************************
/**
+ * @class TAO_ORB_Core_Static_Resources
+ *
+ * @brief The static (global) resoures of all ORB cores.
+ *
+ * This class is used by the ORB_Core to store the resources global to
+ * all ORB_Cores. All instance variables that would have been
+ * declared "static" in TAO_ORB_Core, should be declared in this class
+ * to avoid the "static initialization order fiasco" as described in
+ * http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.11.
+ * Briefly, this is the problem that occurs if any static initializers
+ * in any other code call into set static members of TAO_ORB_Core.
+ * Since the order in which these initializers execute is unspecified,
+ * uninitialized members can be accessed.
+ */
+class TAO_Export TAO_ORB_Core_Static_Resources
+{
+public:
+
+ /// Return the singleton instance.
+ static TAO_ORB_Core_Static_Resources* instance (void);
+
+public:
+ // The hook to be set for the SyncScopePolicy
+ 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_;
+
+ /// The hook to be set for the RelativeRoundtripTimeoutPolicy.
+ TAO_ORB_Core::Timeout_Hook timeout_hook_;
+
+ /// The hook to be set for the ConnectionTimeoutPolicy
+ 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
+ // called to set the value to be "RT_Collocation_Resolver".
+ 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
+ // to be "Advanced_Resource_Factory".
+ ACE_CString resource_factory_name_;
+
+ // Name of the service object for DII request creation that needs
+ // to be instantiated. The default value is "Dynamic_Adaper". If
+ // TAO_DynamicInterface is linked, dynamic_adapter_name() will be
+ // called to set the value to "Concrete_Dynamic_Adapter".
+ ACE_CString dynamic_adapter_name_;
+
+ // Name of the service object for functions that make calls on
+ // the Interface Repository. The default value is "IFR_Client_Adaper".
+ // If TAO_IFR_CLient is linked, ifr_client_adapter_name() will be
+ // called to set the value to "Concrete_IFR_Client_Adapter".
+ ACE_CString ifr_client_adapter_name_;
+
+ // Name of the service object used by the ORB create_*_tc functions.
+ // The default value is "TypeCodeFactory_Adapter". If the
+ // TypeCodeFactory library is linked, the corresponding accessor
+ // function typecodefactory_adapter_name() will be called to set
+ // the value to "Concrete_TypeCodeFactory_Adapter".
+ ACE_CString typecodefactory_adapter_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_;
+
+private:
+
+ /// Constructor.
+ TAO_ORB_Core_Static_Resources (void);
+
+private:
+
+ /// The singleton instance.
+ static TAO_ORB_Core_Static_Resources* instance_;
+
+ /// Mostly unused variable whose sole purpose is to enforce
+ /// the instantiation of a TAO_ORB_Core_Static_Resources instance
+ /// at initialization time.
+ static TAO_ORB_Core_Static_Resources* initialization_reference_;
+};
+
+// ****************************************************************
+
+/**
* @class TAO_ORB_Core_Auto_Ptr
*
* @brief Define a TAO_ORB_Core auto_ptr class.