diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-02-02 08:01:28 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-02-02 08:01:28 +0000 |
commit | 480048ab2c42def1fd9ce4a49321661b7d794f38 (patch) | |
tree | d78371497ae3322df9f0a449ee99681bdac0210a /TAO/tao | |
parent | aa2ff175a23d851dd1b35b9c29eae5108cc254c8 (diff) | |
download | ATCD-480048ab2c42def1fd9ce4a49321661b7d794f38.tar.gz |
Mon Feb 2 08:00:17 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* tao/Thread_Lane_Resources.cpp:
* tao/Transport_Cache_Manager_T.cpp:
* tao/Transport_Cache_Manager_T.h:
Changed the constructor of the TCM to accept all different config
values seperately instead of accepting the orb_core. This makes
it easier to write unit tests for the TCM
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/Thread_Lane_Resources.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/Transport_Cache_Manager_T.cpp | 22 | ||||
-rw-r--r-- | TAO/tao/Transport_Cache_Manager_T.h | 8 |
3 files changed, 27 insertions, 11 deletions
diff --git a/TAO/tao/Thread_Lane_Resources.cpp b/TAO/tao/Thread_Lane_Resources.cpp index 1e554b18cf5..cdfbfe3d780 100644 --- a/TAO/tao/Thread_Lane_Resources.cpp +++ b/TAO/tao/Thread_Lane_Resources.cpp @@ -43,8 +43,12 @@ TAO_Thread_Lane_Resources::TAO_Thread_Lane_Resources ( { // Create the transport cache. ACE_NEW (this->transport_cache_, - TAO::Transport_Cache_Manager (orb_core)); - + TAO::Transport_Cache_Manager ( + orb_core.resource_factory ()->purge_percentage (), + orb_core.resource_factory ()->create_purging_strategy (), + orb_core.resource_factory ()->cache_maximum (), + orb_core.resource_factory ()->locked_transport_cache (), + orb_core.orbid ())); } TAO_Thread_Lane_Resources::~TAO_Thread_Lane_Resources (void) diff --git a/TAO/tao/Transport_Cache_Manager_T.cpp b/TAO/tao/Transport_Cache_Manager_T.cpp index 5e223d96442..71b0d37bd15 100644 --- a/TAO/tao/Transport_Cache_Manager_T.cpp +++ b/TAO/tao/Transport_Cache_Manager_T.cpp @@ -7,6 +7,7 @@ #include "tao/Wait_Strategy.h" #include "ace/ACE.h" #include "ace/Reactor.h" +#include "ace/Lock_Adapter_T.h" #if !defined (__ACE_INLINE__) # include "tao/Transport_Cache_Manager_T.inl" @@ -28,13 +29,18 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO { template <typename TRANSPORT_TYPE, typename TRANSPORT_DESCRIPTOR_TYPE> - Transport_Cache_Manager_T<TRANSPORT_TYPE, TRANSPORT_DESCRIPTOR_TYPE>::Transport_Cache_Manager_T (TAO_ORB_Core &orb_core) - : percent_ (orb_core.resource_factory ()->purge_percentage ()) - , purging_strategy_ (orb_core.resource_factory ()->create_purging_strategy ()) - , cache_map_ (orb_core.resource_factory ()->cache_maximum ()) + Transport_Cache_Manager_T<TRANSPORT_TYPE, TRANSPORT_DESCRIPTOR_TYPE>::Transport_Cache_Manager_T ( + int percent, + TAO_Connection_Purging_Strategy* purging_strategy, + int cache_maximum, + int locked, + const char *orbid) + : percent_ (percent) + , purging_strategy_ (purging_strategy) + , cache_map_ (cache_maximum) , cache_lock_ (0) { - if (orb_core.resource_factory ()->locked_transport_cache ()) + if (locked) { ACE_NEW (this->cache_lock_, ACE_Lock_Adapter <TAO_SYNCH_MUTEX> (this->cache_map_mutex_)); @@ -54,14 +60,16 @@ namespace TAO ACE_CString purge_name ("Connection_Cache_Purge_"); ACE_CString size_name ("Connection_Cache_Size_"); - purge_name += orb_core.orbid (); - size_name += orb_core.orbid (); + purge_name += orbid; + size_name += orbid; this->purge_monitor_->name (purge_name.c_str ()); this->size_monitor_->name (size_name.c_str ()); this->purge_monitor_->add_to_registry (); this->size_monitor_->add_to_registry (); +#else + ACE_UNUSED_ARG (orbid); #endif /* TAO_HAS_MONITOR_POINTS==1 */ } diff --git a/TAO/tao/Transport_Cache_Manager_T.h b/TAO/tao/Transport_Cache_Manager_T.h index 313cbb4dfe2..823e19a54e3 100644 --- a/TAO/tao/Transport_Cache_Manager_T.h +++ b/TAO/tao/Transport_Cache_Manager_T.h @@ -25,7 +25,6 @@ #include "tao/Cache_Entries_T.h" #include "tao/orbconf.h" -#include "tao/ORB_Core.h" #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1) #include "ace/Monitor_Size.h" @@ -97,7 +96,12 @@ namespace TAO // == Public methods /// Constructor - Transport_Cache_Manager_T (TAO_ORB_Core &orb_core); + Transport_Cache_Manager_T ( + int percent, + TAO_Connection_Purging_Strategy* purging_strategy, + int cache_maximum, + int locked, + const char *orbid); /// Destructor ~Transport_Cache_Manager_T (void); |