summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-07-04 21:54:54 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-07-04 21:54:54 +0000
commit6c44b5a341e87717fff0af5de3b0d16d05e08d63 (patch)
tree777bb31c5c3f6b70c864c24415ae214f8b7bbda7
parent1ede7b58704a249db4ebc128163f80f0f9528940 (diff)
downloadATCD-6c44b5a341e87717fff0af5de3b0d16d05e08d63.tar.gz
Thread Pool changes...
-rw-r--r--TAO/tao/Acceptor_Registry.cpp13
-rw-r--r--TAO/tao/Acceptor_Registry.h4
-rw-r--r--TAO/tao/CORBALOC_Parser.cpp1
-rw-r--r--TAO/tao/IIOP_Acceptor.cpp18
-rw-r--r--TAO/tao/IIOP_Acceptor.h5
-rw-r--r--TAO/tao/IIOP_Transport.cpp10
-rw-r--r--TAO/tao/ORB.cpp18
-rw-r--r--TAO/tao/ORB.h7
-rw-r--r--TAO/tao/ORB_Core.cpp182
-rw-r--r--TAO/tao/ORB_Core.h46
-rw-r--r--TAO/tao/ORB_Core.i6
-rw-r--r--TAO/tao/Object.cpp1
-rw-r--r--TAO/tao/Pluggable.h2
-rw-r--r--TAO/tao/RTCORBA/Pool_Per_Endpoint.cpp7
-rw-r--r--TAO/tao/Strategies/SHMIOP_Acceptor.cpp15
-rw-r--r--TAO/tao/Strategies/SHMIOP_Acceptor.h5
-rw-r--r--TAO/tao/Strategies/UIOP_Acceptor.cpp13
-rw-r--r--TAO/tao/Strategies/UIOP_Acceptor.h5
-rw-r--r--TAO/tao/Stub.cpp5
-rw-r--r--TAO/tao/TAO.dsp12
-rw-r--r--TAO/tao/Tagged_Profile.cpp21
-rw-r--r--TAO/tao/Transport_Cache_Manager.cpp37
-rw-r--r--TAO/tao/Transport_Cache_Manager.h6
23 files changed, 205 insertions, 234 deletions
diff --git a/TAO/tao/Acceptor_Registry.cpp b/TAO/tao/Acceptor_Registry.cpp
index 10c21c531e2..027f7aa6c8d 100644
--- a/TAO/tao/Acceptor_Registry.cpp
+++ b/TAO/tao/Acceptor_Registry.cpp
@@ -127,6 +127,7 @@ TAO_Acceptor_Registry::get_acceptor (CORBA::ULong tag)
int
TAO_Acceptor_Registry::open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
@@ -141,7 +142,9 @@ TAO_Acceptor_Registry::open (TAO_ORB_Core *orb_core,
// All TAO pluggable protocols are expected to have the ability
// to create a default endpoint.
- if (this->open_default (orb_core, 0) == -1)
+ if (this->open_default (orb_core,
+ reactor,
+ 0) == -1)
ACE_THROW_RETURN (CORBA::INTERNAL (
CORBA_SystemException::_tao_minor_code (
TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE,
@@ -263,6 +266,7 @@ TAO_Acceptor_Registry::open (TAO_ORB_Core *orb_core,
ACE_CString addrs = iop.substring (slot + 3);
int result = this->open_i (orb_core,
+ reactor,
addrs,
factory,
ACE_TRY_ENV);
@@ -304,6 +308,7 @@ TAO_Acceptor_Registry::open (TAO_ORB_Core *orb_core,
// Iterate through the loaded transport protocols and create a default
// server for each protocol.
int TAO_Acceptor_Registry::open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
const char *options)
{
TAO_ProtocolFactorySet *pfs = orb_core->protocol_factories ();
@@ -336,6 +341,7 @@ int TAO_Acceptor_Registry::open_default (TAO_ORB_Core *orb_core,
if (!(*i)->factory ()->requires_explicit_endpoint ())
{
if (this->open_default (orb_core,
+ reactor,
TAO_DEF_GIOP_MAJOR, // default major
TAO_DEF_GIOP_MINOR, // default minor
i,
@@ -367,6 +373,7 @@ int TAO_Acceptor_Registry::open_default (TAO_ORB_Core *orb_core,
// the indicated protocol.
int
TAO_Acceptor_Registry::open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int major,
int minor,
TAO_ProtocolFactorySetItor &factory,
@@ -392,6 +399,7 @@ TAO_Acceptor_Registry::open_default (TAO_ORB_Core *orb_core,
// Initialize the acceptor to listen on a default endpoint.
if (acceptor->open_default (orb_core,
+ reactor,
major,
minor,
options) == -1)
@@ -478,6 +486,7 @@ TAO_Acceptor_Registry::extract_endpoint_version (ACE_CString &address,
int
TAO_Acceptor_Registry::open_i (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
ACE_CString &addrs,
TAO_ProtocolFactorySetItor &factory,
CORBA::Environment &ACE_TRY_ENV)
@@ -527,6 +536,7 @@ TAO_Acceptor_Registry::open_i (TAO_ORB_Core *orb_core,
// All TAO pluggable protocols are expected to have the
// ability to create a default endpoint.
if (this->open_default (orb_core,
+ reactor,
major,
minor,
factory,
@@ -546,6 +556,7 @@ TAO_Acceptor_Registry::open_i (TAO_ORB_Core *orb_core,
// An explicit endpoint was provided.
else if (acceptor->open (orb_core,
+ reactor,
major,
minor,
address.c_str (),
diff --git a/TAO/tao/Acceptor_Registry.h b/TAO/tao/Acceptor_Registry.h
index c64bb7cfa37..386e3bec198 100644
--- a/TAO/tao/Acceptor_Registry.h
+++ b/TAO/tao/Acceptor_Registry.h
@@ -64,6 +64,7 @@ public:
/// Initialize all registered acceptors. Return -1 on error.
int open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException));
@@ -97,10 +98,12 @@ private:
/// Create a default acceptor for all loaded protocols.
int open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
const char *options);
/// Create a default acceptor using the specified protocol factory.
int open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int major,
int minor,
TAO_ProtocolFactorySetItor &factory,
@@ -120,6 +123,7 @@ private:
/// Iterator through addrs in the string <iop>, and create an
/// acceptor for each one.
int open_i (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
ACE_CString &address,
TAO_ProtocolFactorySetItor &factory,
CORBA::Environment &ACE_TRY_ENV);
diff --git a/TAO/tao/CORBALOC_Parser.cpp b/TAO/tao/CORBALOC_Parser.cpp
index 13f09350804..6786b867f9d 100644
--- a/TAO/tao/CORBALOC_Parser.cpp
+++ b/TAO/tao/CORBALOC_Parser.cpp
@@ -306,7 +306,6 @@ TAO_CORBALOC_Parser::make_stub_from_mprofile (CORBA::ORB_ptr orb,
// Create a TAO_Stub.
TAO_Stub *data = orb->orb_core ()->create_stub ((const char *) 0,
mprofile,
- orb->orb_core (),
ACE_TRY_ENV);
ACE_CHECK_RETURN (CORBA::Object::_nil ());
diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp
index 1a0e99030e2..d2908eaacb2 100644
--- a/TAO/tao/IIOP_Acceptor.cpp
+++ b/TAO/tao/IIOP_Acceptor.cpp
@@ -250,6 +250,7 @@ TAO_IIOP_Acceptor::close (void)
int
TAO_IIOP_Acceptor::open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int major,
int minor,
const char *address,
@@ -309,7 +310,8 @@ TAO_IIOP_Acceptor::open (TAO_ORB_Core *orb_core,
1) != 0)
return -1;
else
- return this->open_i (addr);
+ return this->open_i (addr,
+ reactor);
}
else if (port_separator_loc == 0)
{
@@ -355,11 +357,13 @@ TAO_IIOP_Acceptor::open (TAO_ORB_Core *orb_core,
if (this->addrs_[0].set (addr) != 0)
return -1;
- return this->open_i (addr);
+ return this->open_i (addr,
+ reactor);
}
int
TAO_IIOP_Acceptor::open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int major,
int minor,
const char *options)
@@ -404,11 +408,13 @@ TAO_IIOP_Acceptor::open_default (TAO_ORB_Core *orb_core,
1) != 0)
return -1;
- return this->open_i (addr);
+ return this->open_i (addr,
+ reactor);
}
int
-TAO_IIOP_Acceptor::open_i (const ACE_INET_Addr& addr)
+TAO_IIOP_Acceptor::open_i (const ACE_INET_Addr& addr,
+ ACE_Reactor *reactor)
{
ACE_NEW_RETURN (this->creation_strategy_,
TAO_IIOP_CREATION_STRATEGY (this->orb_core_,
@@ -429,7 +435,7 @@ TAO_IIOP_Acceptor::open_i (const ACE_INET_Addr& addr)
{
// don't care, i.e., let the OS choose an ephemeral port
if (this->base_acceptor_.open (addr,
- this->orb_core_->reactor (this),
+ reactor,
this->creation_strategy_,
this->accept_strategy_,
this->concurrency_strategy_) == -1)
@@ -459,7 +465,7 @@ TAO_IIOP_Acceptor::open_i (const ACE_INET_Addr& addr)
// Now try to actually open on that port
a.set_port_number (p);
if (this->base_acceptor_.open (a,
- this->orb_core_->reactor (this),
+ reactor,
this->creation_strategy_,
this->accept_strategy_,
this->concurrency_strategy_) != -1)
diff --git a/TAO/tao/IIOP_Acceptor.h b/TAO/tao/IIOP_Acceptor.h
index f86cc5ba6e8..ad202abfa9e 100644
--- a/TAO/tao/IIOP_Acceptor.h
+++ b/TAO/tao/IIOP_Acceptor.h
@@ -67,11 +67,13 @@ public:
* Pluggable.h for details.
*/
virtual int open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int version_major,
int version_minor,
const char *address,
const char *options = 0);
virtual int open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int version_major,
int version_minor,
const char *options = 0);
@@ -111,7 +113,8 @@ protected:
* virtual to allow a derived class implementation to be invoked
* instead.
*/
- virtual int open_i (const ACE_INET_Addr &addr);
+ virtual int open_i (const ACE_INET_Addr &addr,
+ ACE_Reactor *reactor);
/**
* Probe the system for available network interfaces, and initialize
diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp
index a680226fd1e..c6e4f8ff9f8 100644
--- a/TAO/tao/IIOP_Transport.cpp
+++ b/TAO/tao/IIOP_Transport.cpp
@@ -6,6 +6,7 @@
#include "tao/IIOP_Acceptor.h"
#include "tao/IIOP_Profile.h"
#include "tao/Acceptor_Registry.h"
+#include "tao/Thread_Lane_Resources.h"
#include "tao/operation_details.h"
#include "tao/Timeprobe.h"
#include "tao/CDR.h"
@@ -390,17 +391,16 @@ void
TAO_IIOP_Transport::set_bidir_context_info (TAO_Operation_Details &opdetails)
{
// Get a handle to the acceptor registry
- TAO_Acceptor_Registry * ar =
- this->orb_core ()->acceptor_registry ();
-
+ TAO_Acceptor_Registry &ar =
+ this->orb_core ()->lane_resources ().acceptor_registry ();
// Get the first acceptor in the registry
- TAO_AcceptorSetIterator acceptor = ar->begin ();
+ TAO_AcceptorSetIterator acceptor = ar.begin ();
IIOP::ListenPointList listen_point_list;
for (;
- acceptor != ar->end ();
+ acceptor != ar.end ();
acceptor++)
{
// Check whether it is a IIOP acceptor
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp
index f54ba3a1d1f..c24b9d44a3a 100644
--- a/TAO/tao/ORB.cpp
+++ b/TAO/tao/ORB.cpp
@@ -1356,23 +1356,6 @@ CORBA_ORB::list_initial_services (CORBA::Environment &ACE_TRY_ENV)
return this->orb_core ()->list_initial_references (ACE_TRY_ENV);
}
-TAO_Stub *
-CORBA_ORB::create_stub_object (const TAO_ObjectKey &key,
- const char *type_id,
- CORBA::PolicyList *policy_list,
- TAO_Acceptor_Filter *filter,
- CORBA::Environment &ACE_TRY_ENV)
-{
- this->check_shutdown (ACE_TRY_ENV);
- ACE_CHECK_RETURN (0);
-
- return this->orb_core_->create_stub_object (key,
- type_id,
- policy_list,
- filter,
- ACE_TRY_ENV);
-}
-
void
CORBA_ORB::check_shutdown (CORBA_Environment &ACE_TRY_ENV)
{
@@ -2024,7 +2007,6 @@ CORBA_ORB::url_ior_string_to_object (const char* str,
// Now make the TAO_Stub.
TAO_Stub *data = this->orb_core_->create_stub ((char *) 0,
mprofile,
- this->orb_core_,
ACE_TRY_ENV);
ACE_CHECK_RETURN (CORBA::Object::_nil ());
diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h
index 44ab97aa7c0..fd2f23961f5 100644
--- a/TAO/tao/ORB.h
+++ b/TAO/tao/ORB.h
@@ -477,13 +477,6 @@ public:
/// Resolve the POA.
CORBA_Object_ptr resolve_root_poa (CORBA_Environment &ACE_TRY_ENV);
- /// Delegates on the ORB_Core to create a TAO_Stub.
- TAO_Stub *create_stub_object (const TAO_ObjectKey &key,
- const char *type_id,
- CORBA::PolicyList *policy_list,
- TAO_Acceptor_Filter *acceptor_filter,
- CORBA_Environment &ACE_TRY_ENV);
-
/// Initialize the ORB globals correctly, i.e., only when they
/// haven't been initialized yet.
static void init_orb_globals (CORBA_Environment &ACE_TRY_ENV =
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 892b7a4fce3..dd4f0d595d8 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -31,6 +31,7 @@
#include "Invocation.h"
#include "BiDir_Adapter.h"
+#include "tao/Thread_Lane_Resources.h"
#include "Default_Stub_Factory.h"
#include "Default_Endpoint_Selector_Factory.h"
#include "Default_Protocols_Hooks.h"
@@ -69,6 +70,8 @@ TAO_ORB_Core::Sync_Scope_Hook TAO_ORB_Core::sync_scope_hook_ = 0;
const char * TAO_ORB_Core::endpoint_selector_factory_name_ =
"Default_Endpoint_Selector_Factory";
+const char * TAO_ORB_Core::thread_lane_resources_manager_name_ =
+ "Default_Thread_Lane_Resources_Manager";
const char * TAO_ORB_Core::stub_factory_name_ =
"Default_Stub_Factory";
const char * TAO_ORB_Core::resource_factory_name_ =
@@ -91,7 +94,7 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid)
protocols_hooks_ (0),
lock_ (),
connector_registry_ (0),
- acceptor_registry_ (0),
+ thread_lane_resources_manager_ (0),
stub_factory_ (0),
protocol_factories_ (0),
implrepo_service_ (CORBA::Object::_nil ()),
@@ -152,8 +155,6 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid)
reactor_ (0),
has_shutdown_ (1),
thread_per_connection_use_timeout_ (1),
- open_lock_ (),
- open_called_ (0),
endpoint_selector_factory_ (0),
// Start the ORB in a "shutdown" state. Only after
// CORBA::ORB_init() is called will the ORB no longer be shutdown.
@@ -1035,9 +1036,9 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV)
this->flushing_strategy_ = trf->create_flushing_strategy ();
// Create the purging strategy
- ACE_NEW_RETURN(this->transport_cache_,
- TAO_Transport_Cache_Manager(trf),
- -1);
+ ACE_NEW_RETURN (this->transport_cache_,
+ TAO_Transport_Cache_Manager (*this),
+ -1);
// Now that we have a complete list of available protocols and their
// related factory objects, set default policies and initialize the
@@ -1074,19 +1075,6 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV)
this,
this->orb_params ()->preconnects ());
- // Open the Transport Cache
- // @@ This seems to be a nice place to configure the transport
- // cache for the number of allowed entries
- if (this->transport_cache_->open (this) == -1)
- {
- ACE_THROW_RETURN (CORBA::INITIALIZE (
- CORBA::SystemException::_tao_minor_code (
- TAO_ORB_CORE_INIT_LOCATION_CODE,
- 0),
- CORBA::COMPLETED_NO),
- -1);
- }
-
// Look for BiDirectional library here. If the user has svc.conf
// file, load the library at this point.
int ret = this->bidirectional_giop_init (ACE_TRY_ENV);
@@ -1160,12 +1148,8 @@ TAO_ORB_Core::fini (void)
delete this->connector_registry_;
}
- // Ask the registry to close all registered acceptors.
- if (this->acceptor_registry_ != 0)
- {
- this->acceptor_registry_->close_all ();
- delete this->acceptor_registry_;
- }
+ // Finalize lane resources.
+ this->thread_lane_resources_manager ()->finalize ();
// Set of file descriptors corresponding to open connections. This
// handle set is used to explicitly deregister the connection event
@@ -1272,11 +1256,16 @@ TAO_ORB_Core::corba_priority_normalizer (TAO_CORBA_Priority_Normalizer *new_norm
}
void
-TAO_ORB_Core::set_stub_factory(const char *stub_factory_name)
+TAO_ORB_Core::set_thread_lane_resources_manager (const char *thread_lane_resources_manager_name)
{
- TAO_ORB_Core::stub_factory_name_ = stub_factory_name;
+ TAO_ORB_Core::thread_lane_resources_manager_name_ = thread_lane_resources_manager_name;
}
+void
+TAO_ORB_Core::set_stub_factory (const char *stub_factory_name)
+{
+ TAO_ORB_Core::stub_factory_name_ = stub_factory_name;
+}
void
TAO_ORB_Core::set_resource_factory (const char *resource_factory_name)
@@ -1364,6 +1353,46 @@ TAO_ORB_Core::resource_factory (void)
return this->resource_factory_;
}
+TAO_Thread_Lane_Resources_Manager *
+TAO_ORB_Core::thread_lane_resources_manager (void)
+{
+ // Check if there is a cached reference.
+ if (this->thread_lane_resources_manager_ != 0)
+ return this->thread_lane_resources_manager_;
+
+ // If not, look in the service repository for an instance.
+ this->thread_lane_resources_manager_ =
+ ACE_Dynamic_Service<TAO_Thread_Lane_Resources_Manager>::instance
+ (TAO_ORB_Core::thread_lane_resources_manager_name_);
+
+ // If there still isn't a reference, allocate the default.
+ if (this->thread_lane_resources_manager_ == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_WARNING,
+ ACE_TEXT ("(%P|%t) WARNING - No Thread Lane Resources Manager found ")
+ ACE_TEXT ("in Service Repository.\n")
+ ACE_TEXT (" Using default instance with GLOBAL resource ")
+ ACE_TEXT ("source specifier.\n")));
+
+ // @@ RTCORBA Subsetting: The following comment probably should say
+ // this if this doesn't work, a segmentation fault will be quickly
+ // generated...
+
+ // This will throw an exception if it fails on exception-throwing
+ // platforms.
+ TAO_Thread_Lane_Resources_Manager *thread_lane_resources_manager;
+ ACE_NEW_RETURN (thread_lane_resources_manager,
+ TAO_Default_Thread_Lane_Resources_Manager,
+ 0);
+
+ // Store a copy for later use.
+ this->thread_lane_resources_manager_ = thread_lane_resources_manager;
+ }
+
+ return this->thread_lane_resources_manager_;
+}
+
TAO_Stub_Factory *
TAO_ORB_Core::stub_factory (void)
{
@@ -1818,15 +1847,14 @@ TAO_ORB_Core::leader_follower_condition_variable (void)
}
TAO_Stub *
-TAO_ORB_Core::create_stub(const char *repository_id,
- const TAO_MProfile &profiles,
- TAO_ORB_Core *orb_core,
- CORBA::Environment &ACE_TRY_ENV)
+TAO_ORB_Core::create_stub (const char *repository_id,
+ const TAO_MProfile &profiles,
+ CORBA::Environment &ACE_TRY_ENV)
{
TAO_Stub *retval =
this->stub_factory ()->create_stub (repository_id,
profiles,
- orb_core,
+ this,
ACE_TRY_ENV);
ACE_CHECK_RETURN(0);
return retval;
@@ -1834,60 +1862,31 @@ TAO_ORB_Core::create_stub(const char *repository_id,
TAO_Stub *
-TAO_ORB_Core::create_stub_object (const TAO_ObjectKey &key,
+TAO_ORB_Core::create_stub_object (TAO_MProfile &mprofile,
const char *type_id,
CORBA::PolicyList *policy_list,
- TAO_Acceptor_Filter *filter,
CORBA::Environment &ACE_TRY_ENV)
{
(void) this->open (ACE_TRY_ENV);
ACE_CHECK_RETURN (0);
- TAO_Stub *stub = 0;
-
- // Create a profile container and have Acceptor_Registry populate it
- // with profiles as appropriate.
- TAO_MProfile mp (0);
- if (this->acceptor_registry ()->make_mprofile (key, mp, filter) == -1)
- {
- ACE_THROW_RETURN (CORBA::INTERNAL (
- CORBA::SystemException::_tao_minor_code (
- TAO_MPROFILE_CREATION_ERROR,
- 0),
- CORBA::COMPLETED_NO),
- 0);
- }
-
- // Make sure we have at least one profile. <mp> may end up being
- // empty if none of the acceptor endpoints have the right priority
- // for this object, for example.
- if (mp.profile_count () == 0)
- {
- ACE_THROW_RETURN (CORBA::BAD_PARAM (
- CORBA::SystemException::_tao_minor_code (
- TAO_MPROFILE_CREATION_ERROR,
- 0 ),
- CORBA::COMPLETED_NO),
- 0);
- }
-
- // Add the Polices contained in "policy_list" to each profile
- // so that those policies will be exposed to the client in the IOR.
- // In particular each CORBA::Policy has to be converted in to
- // Messaging::PolicyValue, and then all the Messaging::PolicyValue
- // should be embedded inside a Messaging::PolicyValueSeq which became
- // in turns the "body" of the IOP::TaggedComponent. This conversion
- // is a responsability of the CORBA::Profile class.
- // (See orbos\98-05-05.pdf Section 5.4)
+ // Add the Polices contained in "policy_list" to each profile so
+ // that those policies will be exposed to the client in the IOR. In
+ // particular each CORBA::Policy has to be converted in to
+ // Messaging::PolicyValue, and then all the Messaging::PolicyValue
+ // should be embedded inside a Messaging::PolicyValueSeq which
+ // became in turns the "body" of the IOP::TaggedComponent. This
+ // conversion is a responsability of the CORBA::Profile class. (See
+ // orbos\98-05-05.pdf Section 5.4)
if (policy_list->length () != 0)
{
TAO_Profile * profile;
- for (CORBA::ULong i = 0; i < mp.profile_count (); ++i)
+ for (CORBA::ULong i = 0; i < mprofile.profile_count (); ++i)
{
// Get the ith profile
- profile = mp.get_profile (i);
+ profile = mprofile.get_profile (i);
profile->policies (policy_list, ACE_TRY_ENV);
ACE_CHECK_RETURN (0);
}
@@ -1896,11 +1895,11 @@ TAO_ORB_Core::create_stub_object (const TAO_ObjectKey &key,
// Iterate over the registered IOR interceptors so that they may be
// given the opportunity to add tagged components to the profiles
// for this servant.
- this->establish_components (mp, policy_list, ACE_TRY_ENV);
+ this->establish_components (mprofile, policy_list, ACE_TRY_ENV);
ACE_CHECK_RETURN (0);
// Done creating profiles. Initialize a TAO_Stub object with them.
- stub = this->create_stub (type_id, mp, this, ACE_TRY_ENV);
+ TAO_Stub *stub = this->create_stub (type_id, mprofile, ACE_TRY_ENV);
ACE_CHECK_RETURN (stub);
stub->base_profiles ().policy_list (policy_list);
@@ -2042,7 +2041,7 @@ TAO_ORB_Core::create_collocated_object (TAO_Stub *stub,
int
TAO_ORB_Core::is_collocated (const TAO_MProfile& mprofile)
{
- if (this->acceptor_registry_ == 0)
+ if (!this->lane_resources ().has_acceptor_registry_been_created ())
return 0;
// @@ Lots of issues arise when dealing with collocation. What about
@@ -2056,7 +2055,7 @@ TAO_ORB_Core::is_collocated (const TAO_MProfile& mprofile)
// address (ORB Host) but not the object_key. This should be checked
// also.
- return this->acceptor_registry_->is_collocated (mprofile);
+ return this->lane_resources ().acceptor_registry ().is_collocated (mprofile);
}
// ****************************************************************
@@ -2293,27 +2292,14 @@ TAO_ORB_Core::destroy_interceptors (CORBA::Environment &ACE_TRY_ENV)
int
TAO_ORB_Core::open (CORBA::Environment &ACE_TRY_ENV)
{
- // Double check pattern
- if (this->open_called_ == 1)
- return 1;
-
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, tao_mon, this->open_lock_, -1);
-
- if (this->open_called_ == 1)
- return 1;
-
- TAO_Acceptor_Registry *ar = this->acceptor_registry ();
- // get a reference to the acceptor_registry!
-
- int ret = ar->open (this, ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
-
- if (ret == -1)
- return -1;
-
- this->open_called_ = 1;
+ // Open lane resources.
+ return this->thread_lane_resources_manager ()->open (ACE_TRY_ENV);
+}
- return 0;
+TAO_Thread_Lane_Resources &
+TAO_ORB_Core::lane_resources (void)
+{
+ return this->thread_lane_resources_manager ()->lane_resources ();
}
void
@@ -3177,7 +3163,6 @@ TAO_ORB_Core_TSS_Resources::TAO_ORB_Core_TSS_Resources (void)
output_cdr_msgblock_allocator_ (0),
input_cdr_dblock_allocator_ (0),
input_cdr_buffer_allocator_ (0),
- transport_cache_ (0),
event_loop_thread_ (0),
client_leader_thread_ (0),
leader_follower_condition_variable_ (0),
@@ -3210,9 +3195,6 @@ TAO_ORB_Core_TSS_Resources::~TAO_ORB_Core_TSS_Resources (void)
this->input_cdr_buffer_allocator_->remove ();
delete this->input_cdr_buffer_allocator_;
- // UNIMPLEMENTED delete this->transport_cache__;
- this->transport_cache_ = 0;
-
delete this->leader_follower_condition_variable_;
this->leader_follower_condition_variable_ = 0;
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index 09e78ba2d3b..2b5bb9d432a 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -48,7 +48,6 @@
// Forward declarations
class TAO_Acceptor;
class TAO_Connector;
-class TAO_Acceptor_Registry;
class TAO_Connector_Registry;
class TAO_Resource_Factory;
@@ -74,10 +73,13 @@ class TAO_BiDir_Adapter;
class TAO_Flushing_Strategy;
+class TAO_Thread_Lane_Resources_Manager;
+class TAO_Thread_Lane_Resources;
class TAO_Stub_Factory;
class TAO_Endpoint_Selector_Factory;
class TAO_Service_Context;
+
#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
class TAO_Buffering_Constraint_Policy;
@@ -139,11 +141,6 @@ public:
ACE_Allocator *input_cdr_msgblock_allocator_;
//@}
- /// This is is just a place holder, in the future the transport
- /// cache will be separated from the connectors and it will be a
- /// (potentially) TSS object.
- TAO_Transport_Cache_Manager *transport_cache_;
-
/// Counter for how (nested) calls this thread has made to run the
/// event loop.
int event_loop_thread_;
@@ -244,9 +241,6 @@ public:
///Get the connector registry
TAO_Connector_Registry *connector_registry (void);
- ///Get the acceptor registry
- TAO_Acceptor_Registry *acceptor_registry (void);
-
///Get the IOR parser registry
TAO_Parser_Registry *parser_registry (void);
@@ -400,13 +394,20 @@ public:
/// Returns pointer to the Protocol_Hooks.
TAO_Protocols_Hooks *protocols_hooks (void);
+ /// Returns a pointer to the Thread Lane Resources Manager.
+ TAO_Thread_Lane_Resources_Manager *thread_lane_resources_manager (void);
+
/// Returns a pointer to the Stub factory.
TAO_Stub_Factory *stub_factory (void);
/// Returns a pointer to the endpoint selector factory.
TAO_Endpoint_Selector_Factory *endpoint_selector_factory (void);
+
//@}
+ /// Sets the value of TAO_ORB_Core::thread_lane_resources_manager_name_
+ static void set_thread_lane_resources_manager (const char *thread_lane_resources_manager_name);
+
/// Sets the value of TAO_ORB_Core::stub_factory_name_
static void set_stub_factory (const char *stub_factory_name);
@@ -646,6 +647,9 @@ public:
/// Get access to the leader follower strategy.
TAO_LF_Strategy &lf_strategy (void);
+ /// Get access to the thread lane resources.
+ TAO_Thread_Lane_Resources &lane_resources (void);
+
/// Run the event loop.
int run (ACE_Time_Value *tv,
int perform_work,
@@ -675,10 +679,9 @@ public:
/// Makes sure that the ORB is open and then creates a TAO_Stub
/// based on the endpoint.
- TAO_Stub *create_stub_object (const TAO_ObjectKey &key,
+ TAO_Stub *create_stub_object (TAO_MProfile &mprofile,
const char *type_id,
CORBA::PolicyList *policy_list,
- TAO_Acceptor_Filter *filter,
CORBA::Environment &ACE_TRY_ENV);
/// Factory method that create the "right" Stub depending on
@@ -687,7 +690,6 @@ public:
/// on the fact that RTCORBA is being used or not.
TAO_Stub *create_stub (const char *repository_id,
const TAO_MProfile &profiles,
- TAO_ORB_Core *orb_core,
CORBA::Environment &ACE_TRY_ENV);
@@ -984,9 +986,7 @@ protected:
/// themselves with.
TAO_Connector_Registry *connector_registry_;
- /// The registry which maintains a list of acceptor factories for
- /// each loaded protocol.
- TAO_Acceptor_Registry *acceptor_registry_;
+ TAO_Thread_Lane_Resources_Manager *thread_lane_resources_manager_;
TAO_Stub_Factory *stub_factory_;
@@ -1066,6 +1066,13 @@ protected:
// called to set the value to be "RT_Endpoint_Selector_Factory".
static const char *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". 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".
+ static const char *thread_lane_resources_manager_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
@@ -1226,13 +1233,6 @@ protected:
ACE_Time_Value thread_per_connection_timeout_;
//@}
-
- /// Mutual exclusion for calling open.
- TAO_SYNCH_MUTEX open_lock_;
-
- /// Flag which denotes that the open method was called.
- int open_called_;
-
TAO_Endpoint_Selector_Factory *endpoint_selector_factory_;
#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
@@ -1267,7 +1267,7 @@ protected:
TAO_Parser_Registry parser_registry_;
/// TAO's connection cache
- TAO_Transport_Cache_Manager* transport_cache_;
+ TAO_Transport_Cache_Manager *transport_cache_;
/// BiDirectional GIOP factory
TAO_BiDir_Adapter *bidir_adapter_;
diff --git a/TAO/tao/ORB_Core.i b/TAO/tao/ORB_Core.i
index 8fe1c4ad291..00789a5194d 100644
--- a/TAO/tao/ORB_Core.i
+++ b/TAO/tao/ORB_Core.i
@@ -234,12 +234,6 @@ TAO_ORB_Core::connector_registry (void)
return TAO_OC_RETRIEVE (connector_registry);
}
-ACE_INLINE TAO_Acceptor_Registry *
-TAO_ORB_Core::acceptor_registry (void)
-{
- return TAO_OC_RETRIEVE (acceptor_registry);
-}
-
ACE_INLINE TAO_Parser_Registry *
TAO_ORB_Core::parser_registry (void)
{
diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp
index ff8221baaae..ce0f0a79638 100644
--- a/TAO/tao/Object.cpp
+++ b/TAO/tao/Object.cpp
@@ -594,7 +594,6 @@ operator>> (TAO_InputCDR& cdr, CORBA_Object*& x)
TAO_Stub *objdata = orb_core->create_stub (type_hint.in (),
mp,
- orb_core,
TAO_default_environment ());
// @@ RTCORBA_Subsetting FIX THIS!! ACE_CHECK_RETURN (0);
diff --git a/TAO/tao/Pluggable.h b/TAO/tao/Pluggable.h
index 7e741f086af..cf89effe709 100644
--- a/TAO/tao/Pluggable.h
+++ b/TAO/tao/Pluggable.h
@@ -75,6 +75,7 @@ public:
/// Method to initialize acceptor for address.
virtual int open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int version_major,
int version_minor,
const char *address,
@@ -89,6 +90,7 @@ public:
* removed in the near future.
*/
virtual int open_default (TAO_ORB_Core *,
+ ACE_Reactor *reactor,
int version_major,
int version_minor,
const char *options = 0) = 0;
diff --git a/TAO/tao/RTCORBA/Pool_Per_Endpoint.cpp b/TAO/tao/RTCORBA/Pool_Per_Endpoint.cpp
index 5a926b83ed4..6dbd6bfa4cc 100644
--- a/TAO/tao/RTCORBA/Pool_Per_Endpoint.cpp
+++ b/TAO/tao/RTCORBA/Pool_Per_Endpoint.cpp
@@ -4,6 +4,7 @@
#include "tao/ORB.h"
#include "tao/ORB_Core.h"
#include "tao/Acceptor_Registry.h"
+#include "tao/Thread_Lane_Resources.h"
#include "tao/Pluggable.h"
#include "Priority_Mapping_Manager.h"
#include "tao/debug.h"
@@ -46,10 +47,10 @@ TAO_Pool_Per_Endpoint::run (CORBA::Environment &ACE_TRY_ENV)
RTCORBA::PriorityMapping *pm =
mapping_manager.in ()->mapping ();
- TAO_Acceptor_Registry *ac =
- this->orb_->orb_core ()->acceptor_registry ();
+ TAO_Acceptor_Registry &ac =
+ this->orb_->orb_core ()->lane_resources ().acceptor_registry ();
- for (TAO_AcceptorSetIterator i = ac->begin (); i != ac->end (); ++i)
+ for (TAO_AcceptorSetIterator i = ac.begin (); i != ac.end (); ++i)
{
int priority =
ACE_Sched_Params::priority_min (this->policy_);
diff --git a/TAO/tao/Strategies/SHMIOP_Acceptor.cpp b/TAO/tao/Strategies/SHMIOP_Acceptor.cpp
index 170a6b353b0..898a2561217 100644
--- a/TAO/tao/Strategies/SHMIOP_Acceptor.cpp
+++ b/TAO/tao/Strategies/SHMIOP_Acceptor.cpp
@@ -196,6 +196,7 @@ TAO_SHMIOP_Acceptor::close (void)
int
TAO_SHMIOP_Acceptor::open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int major,
int minor,
const char *port,
@@ -216,11 +217,13 @@ TAO_SHMIOP_Acceptor::open (TAO_ORB_Core *orb_core,
if (port)
this->address_.set (port);
- return this->open_i (orb_core);
+ return this->open_i (orb_core,
+ reactor);
}
int
TAO_SHMIOP_Acceptor::open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int major,
int minor,
const char *options)
@@ -241,7 +244,8 @@ TAO_SHMIOP_Acceptor::open_default (TAO_ORB_Core *orb_core,
this->host_ = this->address_.get_host_name ();
- return this->open_i (orb_core);
+ return this->open_i (orb_core,
+ reactor);
}
int
@@ -255,7 +259,8 @@ TAO_SHMIOP_Acceptor::set_mmap_options (const ACE_TCHAR *prefix,
}
int
-TAO_SHMIOP_Acceptor::open_i (TAO_ORB_Core* orb_core)
+TAO_SHMIOP_Acceptor::open_i (TAO_ORB_Core* orb_core,
+ ACE_Reactor *reactor)
{
this->orb_core_ = orb_core;
@@ -276,7 +281,7 @@ TAO_SHMIOP_Acceptor::open_i (TAO_ORB_Core* orb_core)
// We only accept connection on localhost.
// ACE_INET_Addr local_addr (addr.get_port_number (), ACE_TEXT ("localhost"));
if (this->base_acceptor_.open (this->address_,
- this->orb_core_->reactor (this),
+ reactor,
this->creation_strategy_,
this->accept_strategy_,
this->concurrency_strategy_) == -1)
@@ -321,7 +326,7 @@ TAO_SHMIOP_Acceptor::open_i (TAO_ORB_Core* orb_core)
(void) this->base_acceptor_.acceptor().enable (ACE_CLOEXEC);
// This avoids having child processes acquire the listen socket thereby
// denying the server the opportunity to restart on a well-known endpoint.
- // This does not affect the aberrent behavior on Win32 platforms.
+ // This does not affect the aberrent behavior on Win32 platforms.
if (TAO_debug_level > 5)
{
diff --git a/TAO/tao/Strategies/SHMIOP_Acceptor.h b/TAO/tao/Strategies/SHMIOP_Acceptor.h
index de7e801cf94..1b0bed6851c 100644
--- a/TAO/tao/Strategies/SHMIOP_Acceptor.h
+++ b/TAO/tao/Strategies/SHMIOP_Acceptor.h
@@ -60,11 +60,13 @@ public:
// = The TAO_Acceptor methods, check the documentation in
// Pluggable.h for details.
virtual int open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int version_major,
int version_minor,
const char *port,
const char *options = 0);
virtual int open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int version_major,
int version_minor,
const char *options = 0);
@@ -85,7 +87,8 @@ public:
// use.
private:
- int open_i (TAO_ORB_Core* orb_core);
+ int open_i (TAO_ORB_Core* orb_core,
+ ACE_Reactor *reactor);
// Implement the common part of the open*() methods.
virtual int parse_options (const char *options);
diff --git a/TAO/tao/Strategies/UIOP_Acceptor.cpp b/TAO/tao/Strategies/UIOP_Acceptor.cpp
index 7213bd93d2c..8c99460db16 100644
--- a/TAO/tao/Strategies/UIOP_Acceptor.cpp
+++ b/TAO/tao/Strategies/UIOP_Acceptor.cpp
@@ -221,6 +221,7 @@ TAO_UIOP_Acceptor::close (void)
int
TAO_UIOP_Acceptor::open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int major,
int minor,
const char *address,
@@ -243,11 +244,13 @@ TAO_UIOP_Acceptor::open (TAO_ORB_Core *orb_core,
if (this->parse_options (options) == -1)
return -1;
else
- return this->open_i (address);
+ return this->open_i (address,
+ reactor);
}
int
TAO_UIOP_Acceptor::open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int major,
int minor,
const char *options)
@@ -273,11 +276,13 @@ TAO_UIOP_Acceptor::open_default (TAO_ORB_Core *orb_core,
if (tempname.get () == 0)
return -1;
- return this->open_i (tempname.get ());
+ return this->open_i (tempname.get (),
+ reactor);
}
int
-TAO_UIOP_Acceptor::open_i (const char *rendezvous)
+TAO_UIOP_Acceptor::open_i (const char *rendezvous,
+ ACE_Reactor *reactor)
{
ACE_NEW_RETURN (this->creation_strategy_,
TAO_UIOP_CREATION_STRATEGY (this->orb_core_,
@@ -298,7 +303,7 @@ TAO_UIOP_Acceptor::open_i (const char *rendezvous)
this->rendezvous_point (addr, rendezvous);
if (this->base_acceptor_.open (addr,
- this->orb_core_->reactor (this),
+ reactor,
this->creation_strategy_,
this->accept_strategy_,
this->concurrency_strategy_) == -1)
diff --git a/TAO/tao/Strategies/UIOP_Acceptor.h b/TAO/tao/Strategies/UIOP_Acceptor.h
index cd7fb42a95e..e10acb53267 100644
--- a/TAO/tao/Strategies/UIOP_Acceptor.h
+++ b/TAO/tao/Strategies/UIOP_Acceptor.h
@@ -65,11 +65,13 @@ public:
// = The TAO_Acceptor methods, check the documentation in
// Pluggable.h for details.
virtual int open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int version_major,
int version_minor,
const char *address,
const char *options = 0);
virtual int open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
int version_major,
int version_minor,
const char *options = 0);
@@ -84,7 +86,8 @@ public:
virtual int object_key (IOP::TaggedProfile &profile,
TAO_ObjectKey &key);
private:
- int open_i (const char *rendezvous);
+ int open_i (const char *rendezvous,
+ ACE_Reactor *reactor);
// Implement the common part of the open*() methods
void rendezvous_point (ACE_UNIX_Addr &, const char *rendezvous);
diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp
index 2c308688fb5..beacffdf72e 100644
--- a/TAO/tao/Stub.cpp
+++ b/TAO/tao/Stub.cpp
@@ -511,7 +511,6 @@ TAO_Stub::set_policy_overrides (const CORBA::PolicyList & policies,
TAO_Stub* stub = this->orb_core_->create_stub (this->type_id.in (),
this->base_profiles_,
- this->orb_core_.get (),
ACE_TRY_ENV);
ACE_CHECK_RETURN (0);
@@ -688,7 +687,7 @@ TAO_Stub::buffering_constraint (void)
TAO_Policy_Current &policy_current =
this->orb_core_->policy_current ();
- result =
+ result =
policy_current.get_cached_policy (TAO_CACHED_POLICY_BUFFERING_CONSTRAINT);
}
@@ -701,7 +700,7 @@ TAO_Stub::buffering_constraint (void)
this->orb_core_->policy_manager ();
if (policy_manager != 0)
{
- result =
+ result =
policy_manager->get_cached_policy (TAO_CACHED_POLICY_BUFFERING_CONSTRAINT);
}
}
diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp
index 15ae0b9c8d4..8ba364e42c7 100644
--- a/TAO/tao/TAO.dsp
+++ b/TAO/tao/TAO.dsp
@@ -795,6 +795,10 @@ SOURCE=.\target_specification.cpp
# End Source File
# Begin Source File
+SOURCE=.\Thread_Lane_Resources.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\TimeBaseC.cpp
# End Source File
# Begin Source File
@@ -1595,6 +1599,10 @@ SOURCE=.\target_specification.h
# End Source File
# Begin Source File
+SOURCE=.\Thread_Lane_Resources.h
+# End Source File
+# Begin Source File
+
SOURCE=.\TimeBaseC.h
# End Source File
# Begin Source File
@@ -2179,6 +2187,10 @@ SOURCE=.\target_specification.i
# End Source File
# Begin Source File
+SOURCE=.\Thread_Lane_Resources.i
+# End Source File
+# Begin Source File
+
SOURCE=.\TimeBaseC.i
# End Source File
# Begin Source File
diff --git a/TAO/tao/Tagged_Profile.cpp b/TAO/tao/Tagged_Profile.cpp
index 454895089c5..7f64dc761c1 100644
--- a/TAO/tao/Tagged_Profile.cpp
+++ b/TAO/tao/Tagged_Profile.cpp
@@ -3,6 +3,7 @@
#include "tao/Tagged_Profile.h"
#include "tao/ORB_Core.h"
#include "tao/Acceptor_Registry.h"
+#include "tao/Thread_Lane_Resources.h"
#include "tao/Pluggable.h"
#include "tao/debug.h"
@@ -12,27 +13,27 @@
ACE_RCSID(tao, Tagged_Profile, "$Id$")
-CORBA::Boolean
-TAO_Tagged_Profile::extract_object_key (IOP::TaggedProfile &profile)
+CORBA::Boolean
+TAO_Tagged_Profile::extract_object_key (IOP::TaggedProfile &profile)
{
// Get our Acceptor registry
- TAO_Acceptor_Registry *acceptor_registry =
- this->orb_core_->acceptor_registry ();
-
+ TAO_Acceptor_Registry &acceptor_registry =
+ this->orb_core_->lane_resources ().acceptor_registry ();
+
// Get the right acceptor for the tag in the TaggedProfile
- TAO_Acceptor *acceptor =
- acceptor_registry->get_acceptor (profile.tag);
-
+ TAO_Acceptor *acceptor =
+ acceptor_registry.get_acceptor (profile.tag);
+
if (acceptor)
{
// Get the object key
- int retval =
+ int retval =
acceptor->object_key (profile,
this->object_key_);
if (retval == -1)
return 0;
}
- else
+ else
{
if (TAO_debug_level > 0)
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/TAO/tao/Transport_Cache_Manager.cpp b/TAO/tao/Transport_Cache_Manager.cpp
index 8056d2f26b1..e6887fd19cf 100644
--- a/TAO/tao/Transport_Cache_Manager.cpp
+++ b/TAO/tao/Transport_Cache_Manager.cpp
@@ -18,17 +18,14 @@ ACE_RCSID (TAO,
Transport_Cache_Manager,
"$Id$")
-
-TAO_Transport_Cache_Manager::TAO_Transport_Cache_Manager (
- TAO_Resource_Factory* rf)
- : percent_ (rf->purge_percentage ()),
- purging_strategy_ (rf->create_purging_strategy ()),
+TAO_Transport_Cache_Manager::TAO_Transport_Cache_Manager (TAO_ORB_Core &orb_core)
+ : percent_ (orb_core.resource_factory ()->purge_percentage ()),
+ purging_strategy_ (orb_core.resource_factory ()->create_purging_strategy ()),
cache_map_ (),
- cache_lock_ (0)
+ cache_lock_ (orb_core.resource_factory ()->create_cached_connection_lock ())
{
}
-
TAO_Transport_Cache_Manager::~TAO_Transport_Cache_Manager (void)
{
// Delete the lock that we have
@@ -39,32 +36,6 @@ TAO_Transport_Cache_Manager::~TAO_Transport_Cache_Manager (void)
}
int
-TAO_Transport_Cache_Manager::open (TAO_ORB_Core *orb_core,
- size_t size)
-{
- if (this->purging_strategy_ == 0)
- {
- return -1;
- }
-
- // Create the cache_lock
- this->cache_lock_ =
- orb_core->resource_factory ()->create_cached_connection_lock ();
-
- if (this->cache_lock_ == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("TAO (%P|%t) ERROR TAO_Transport_Cache_Manager::open: "),
- ACE_TEXT ("Lock creation error\n")),
- -1);
- }
-
- // Now open the cache map
- return this->cache_map_.open (size);
-}
-
-
-int
TAO_Transport_Cache_Manager::bind_i (TAO_Cache_ExtId &ext_id,
TAO_Cache_IntId &int_id)
{
diff --git a/TAO/tao/Transport_Cache_Manager.h b/TAO/tao/Transport_Cache_Manager.h
index 92a73ef2330..818bc643a42 100644
--- a/TAO/tao/Transport_Cache_Manager.h
+++ b/TAO/tao/Transport_Cache_Manager.h
@@ -82,7 +82,7 @@ public:
// == Public methods
/// Constructor
- TAO_Transport_Cache_Manager (TAO_Resource_Factory* rf);
+ TAO_Transport_Cache_Manager (TAO_ORB_Core &orb_core);
/// Destructor
virtual ~TAO_Transport_Cache_Manager (void);
@@ -98,10 +98,6 @@ public:
int find_transport (TAO_Transport_Descriptor_Interface *prop,
TAO_Transport *&transport);
- /// Initialize a <HASH_MAP> with <size> elements.
- int open (TAO_ORB_Core *orb_core,
- size_t size = ACE_DEFAULT_MAP_SIZE);
-
/// Remove entries from the cache depending upon the strategy.
int purge (void);