TAO_Thread_Lane_Resources Class Reference

Class representing a thread lane's resources. More...

#include <Thread_Lane_Resources.h>

Collaboration diagram for TAO_Thread_Lane_Resources:

Collaboration graph
[legend]
List of all members.

Accessors

TAO_Acceptor_Registryacceptor_registry (void)
TAO_Connector_Registryconnector_registry (void)
TAO::Transport_Cache_Manager & transport_cache (void)
TAO_Leader_Followerleader_follower (void)
ACE_Allocatorinput_cdr_dblock_allocator (void)
ACE_Allocatorinput_cdr_buffer_allocator (void)
ACE_Allocatorinput_cdr_msgblock_allocator (void)
ACE_Allocatortransport_message_buffer_allocator (void)
ACE_Allocatoroutput_cdr_dblock_allocator (void)
ACE_Allocatoroutput_cdr_buffer_allocator (void)
ACE_Allocatoroutput_cdr_msgblock_allocator (void)
ACE_Allocatoramh_response_handler_allocator (void)
ACE_Allocatorami_response_handler_allocator (void)

The allocators for the input CDR streams.

ACE_Allocatorinput_cdr_dblock_allocator_
ACE_Allocatorinput_cdr_buffer_allocator_
ACE_Allocatorinput_cdr_msgblock_allocator_

The allocators for the buffering messages in the transport.

ACE_Allocatortransport_message_buffer_allocator_

The allocators for the output CDR streams.

ACE_Allocatoroutput_cdr_dblock_allocator_
ACE_Allocatoroutput_cdr_buffer_allocator_
ACE_Allocatoroutput_cdr_msgblock_allocator_

The allocators for AMH.

ACE_Allocatoramh_response_handler_allocator_

The allocators for AMI.

ACE_Allocatorami_response_handler_allocator_

Public Member Functions

 TAO_Thread_Lane_Resources (TAO_ORB_Core &orb_core, TAO_New_Leader_Generator *new_leader_generator=0)
 Constructor.
 ~TAO_Thread_Lane_Resources (void)
 Destructor.
int is_collocated (const TAO_MProfile &mprofile)
int open_acceptor_registry (const TAO_EndpointSet &endpoint_set, bool ignore_address)
 Open the acceptor registry.
void finalize (void)
 Finalize resources.
void shutdown_reactor (void)
 Shutdown the reactor.
void cleanup_rw_transports (void)

Private Member Functions

int has_acceptor_registry_been_created (void) const
 Checks if the acceptor registry has been created.
TAO_Resource_Factoryresource_factory (void)
 Helper to get the resource factory in the ORB_Core.

Private Attributes

TAO_ORB_Coreorb_core_
 ORB_Core related to this thread lane.
TAO_Acceptor_Registryacceptor_registry_
TAO_Connector_Registryconnector_registry_
TAO::Transport_Cache_Manager * transport_cache_
 Transport cache.
TAO_Leader_Followerleader_follower_
 The leader/followers management class for this lane.
TAO_SYNCH_MUTEX lock_
 Synchronization.
TAO_New_Leader_Generatornew_leader_generator_
 Generator of new leader threads.

Detailed Description

Class representing a thread lane's resources.

Definition at line 55 of file Thread_Lane_Resources.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Thread_Lane_Resources::TAO_Thread_Lane_Resources ( TAO_ORB_Core orb_core,
TAO_New_Leader_Generator new_leader_generator = 0 
)

Constructor.

Definition at line 23 of file Thread_Lane_Resources.cpp.

References ACE_NEW.

00027   : orb_core_ (orb_core),
00028     acceptor_registry_ (0),
00029     connector_registry_ (0),
00030     transport_cache_ (0),
00031     leader_follower_ (0),
00032     new_leader_generator_ (new_leader_generator),
00033     input_cdr_dblock_allocator_ (0),
00034     input_cdr_buffer_allocator_ (0),
00035     input_cdr_msgblock_allocator_ (0),
00036     transport_message_buffer_allocator_ (0),
00037     output_cdr_dblock_allocator_ (0),
00038     output_cdr_buffer_allocator_ (0),
00039     output_cdr_msgblock_allocator_ (0),
00040     amh_response_handler_allocator_ (0),
00041     ami_response_handler_allocator_ (0)
00042 {
00043   // Create the transport cache.
00044   ACE_NEW (this->transport_cache_,
00045            TAO::Transport_Cache_Manager (orb_core));
00046 
00047 }

TAO_Thread_Lane_Resources::~TAO_Thread_Lane_Resources ( void   ) 

Destructor.

Definition at line 49 of file Thread_Lane_Resources.cpp.

00050 {
00051 
00052 }


Member Function Documentation

TAO_Acceptor_Registry & TAO_Thread_Lane_Resources::acceptor_registry ( void   ) 

Definition at line 78 of file Thread_Lane_Resources.cpp.

References acceptor_registry_, ACE_GUARD_RETURN, TAO_Resource_Factory::get_acceptor_registry(), orb_core_, TAO_ORB_Core::resource_factory(), resource_factory(), and TAO_SYNCH_MUTEX.

Referenced by is_collocated(), open_acceptor_registry(), and TAO_IIOP_Transport::set_bidir_context_info().

00079 {
00080   // Double check.
00081   if (this->acceptor_registry_ == 0)
00082     {
00083       // @todo: Wouldnt this crash big time if you happen to
00084       // dereference a null-pointer? Needs fixing.
00085       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
00086                         ace_mon,
00087                         this->lock_,
00088                         *this->acceptor_registry_);
00089 
00090       if (this->acceptor_registry_ == 0)
00091         {
00092           // @@ Not exception safe code
00093           // Get the resource factory.
00094           TAO_Resource_Factory &resource_factory =
00095             *this->orb_core_.resource_factory ();
00096 
00097           // Ask it to create a new acceptor registry.
00098           this->acceptor_registry_ =
00099             resource_factory.get_acceptor_registry ();
00100         }
00101     }
00102 
00103   return *this->acceptor_registry_;
00104 }

ACE_Allocator * TAO_Thread_Lane_Resources::amh_response_handler_allocator ( void   ) 

Definition at line 309 of file Thread_Lane_Resources.cpp.

References ACE_GUARD_RETURN, TAO_Resource_Factory::amh_response_handler_allocator(), amh_response_handler_allocator_, resource_factory(), and TAO_SYNCH_MUTEX.

00310 {
00311   if (this->amh_response_handler_allocator_ == 0)
00312     {
00313       // Double checked locking
00314       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
00315 
00316       if (this->amh_response_handler_allocator_ == 0)
00317         {
00318           this->amh_response_handler_allocator_ =
00319             this->resource_factory ()->amh_response_handler_allocator ();
00320         }
00321     }
00322 
00323   return this->amh_response_handler_allocator_;
00324 }

ACE_Allocator * TAO_Thread_Lane_Resources::ami_response_handler_allocator ( void   ) 

Definition at line 327 of file Thread_Lane_Resources.cpp.

References ACE_GUARD_RETURN, TAO_Resource_Factory::ami_response_handler_allocator(), ami_response_handler_allocator_, resource_factory(), and TAO_SYNCH_MUTEX.

00328 {
00329   if (this->ami_response_handler_allocator_ == 0)
00330     {
00331       // Double checked locking
00332       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
00333 
00334       if (this->ami_response_handler_allocator_ == 0)
00335         {
00336           this->ami_response_handler_allocator_ =
00337             this->resource_factory ()->ami_response_handler_allocator ();
00338         }
00339     }
00340 
00341   return this->ami_response_handler_allocator_;
00342 }

void TAO_Thread_Lane_Resources::cleanup_rw_transports ( void   ) 

Certain ORB policies such as dropping replies on shutdown with RW connection handlers would need cleanup of transports to wake threads up.

Definition at line 514 of file Thread_Lane_Resources.cpp.

References transport_cache_.

Referenced by TAO_Default_Thread_Lane_Resources_Manager::cleanup_rw_transports().

00515 {
00516   // If we have no-drop-reply strategy or already fininalized simply return.
00517   if (!this->orb_core_.resource_factory ()->drop_replies_during_shutdown () ||
00518        this->transport_cache_ == 0)
00519     return;
00520 
00521   // Set of handlers still in the connection cache.
00522   TAO::Connection_Handler_Set handlers;
00523 
00524   this->transport_cache_->blockable_client_transports (handlers);
00525 
00526   // Go through the handler set, closing the connections and removing
00527   // the references.
00528   TAO_Connection_Handler **handler = 0;
00529 
00530   for (TAO::Connection_Handler_Set::iterator iter (handlers);
00531        iter.next (handler);
00532        iter.advance ())
00533     {
00534       // Connection is closed. There will be a double closure but that
00535       // is okay.
00536       (*handler)->release_os_resources ();
00537 
00538       // #REFCOUNT# related to the handler set decreases.
00539       (*handler)->transport ()->remove_reference ();
00540     }
00541 }

TAO_Connector_Registry * TAO_Thread_Lane_Resources::connector_registry ( void   ) 

Definition at line 107 of file Thread_Lane_Resources.cpp.

References CORBA::SystemException::_tao_minor_code(), ACE_GUARD_RETURN, CORBA::COMPLETED_NO, connector_registry_, TAO_Resource_Factory::get_connector_registry(), TAO_Connector_Registry::open(), orb_core_, TAO_ORB_Core::resource_factory(), TAO_CONNECTOR_REGISTRY_INIT_LOCATION_CODE, and TAO_SYNCH_MUTEX.

Referenced by TAO_ORB_Core::connector_registry().

00108 {
00109   // Double check.
00110   if (this->connector_registry_ == 0)
00111     {
00112       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
00113                         ace_mon,
00114                         this->lock_,
00115                         0);
00116 
00117       if (this->connector_registry_ == 0)
00118         {
00119           // Ask it to create a new acceptor registry.
00120           TAO_Connector_Registry *connector_registry =
00121             this->orb_core_.resource_factory ()->get_connector_registry ();
00122 
00123           if (connector_registry == 0)
00124             {
00125               throw ::CORBA::INITIALIZE (
00126                 CORBA::SystemException::_tao_minor_code (
00127                   TAO_CONNECTOR_REGISTRY_INIT_LOCATION_CODE,
00128                   0),
00129                 CORBA::COMPLETED_NO);
00130             }
00131 
00132           if (connector_registry->open (&this->orb_core_) != 0)
00133             {
00134               throw ::CORBA::INITIALIZE (
00135                 CORBA::SystemException::_tao_minor_code (
00136                   TAO_CONNECTOR_REGISTRY_INIT_LOCATION_CODE,
00137                   0),
00138                 CORBA::COMPLETED_NO);
00139             }
00140 
00141           // Finally, everything is created and opened successfully:
00142           // now we can assign to the member.  Otherwise, the
00143           // assignment would be premature.
00144           this->connector_registry_ = connector_registry;
00145         }
00146     }
00147 
00148   return this->connector_registry_;
00149 }

void TAO_Thread_Lane_Resources::finalize ( void   ) 

Finalize resources.

Definition at line 365 of file Thread_Lane_Resources.cpp.

References acceptor_registry_, amh_response_handler_allocator_, ami_response_handler_allocator_, TAO_Acceptor_Registry::close_all(), TAO_Connector_Registry::close_all(), connector_registry_, input_cdr_buffer_allocator_, input_cdr_dblock_allocator_, input_cdr_msgblock_allocator_, leader_follower_, output_cdr_buffer_allocator_, output_cdr_dblock_allocator_, output_cdr_msgblock_allocator_, ACE_Allocator::remove(), transport_cache_, and transport_message_buffer_allocator_.

Referenced by TAO_Default_Thread_Lane_Resources_Manager::finalize().

00366 {
00367   // Close connectors before acceptors!
00368   // Ask the registry to close all registered connectors.
00369   if (this->connector_registry_ != 0)
00370     {
00371       this->connector_registry_->close_all ();
00372       delete this->connector_registry_;
00373       this->connector_registry_ = 0;
00374     }
00375 
00376   // Ask the registry to close all registered acceptors.
00377   if (this->acceptor_registry_ != 0)
00378     {
00379       this->acceptor_registry_->close_all ();
00380       delete this->acceptor_registry_;
00381       this->acceptor_registry_ = 0;
00382     }
00383 
00384   // Set of handlers still in the connection cache.
00385   TAO::Connection_Handler_Set handlers;
00386 
00387   // Close the transport cache and return the handlers that were still
00388   // registered.  The cache will decrease the #REFCOUNT# on the
00389   // handler when it removes the handler from cache.  However,
00390   // #REFCOUNT# is increased when the handler is placed in the handler
00391   // set.
00392   this->transport_cache_->close (handlers);
00393 
00394   // Go through the handler set, closing the connections and removing
00395   // the references.
00396   TAO_Connection_Handler **handler = 0;
00397 
00398   for (TAO::Connection_Handler_Set::iterator iter (handlers);
00399        iter.next (handler);
00400        iter.advance ())
00401     {
00402       // Connection is closed.  Potential removal from the Reactor.
00403       (*handler)->close_connection ();
00404 
00405       // #REFCOUNT# related to the handler set decreases.
00406       (*handler)->transport ()->remove_reference ();
00407     }
00408 
00409   delete this->transport_cache_;
00410   this->transport_cache_ = 0;
00411 
00412   delete this->leader_follower_;
00413   this->leader_follower_ = 0;
00414 
00415   // Delete all the allocators here.. They shouldnt be done earlier,
00416   // lest some of the contents in the above, say reactor or acceptor
00417   // may use memory from the pool..
00418   if (this->input_cdr_dblock_allocator_ != 0)
00419     {
00420       this->input_cdr_dblock_allocator_->remove ();
00421       delete this->input_cdr_dblock_allocator_;
00422       this->input_cdr_dblock_allocator_ = 0;
00423     }
00424 
00425   if (this->input_cdr_buffer_allocator_ != 0)
00426     {
00427       this->input_cdr_buffer_allocator_->remove ();
00428       delete this->input_cdr_buffer_allocator_;
00429       this->input_cdr_buffer_allocator_ = 0;
00430     }
00431 
00432   if (this->input_cdr_msgblock_allocator_ != 0)
00433     {
00434       this->input_cdr_msgblock_allocator_->remove ();
00435       delete this->input_cdr_msgblock_allocator_;
00436       this->input_cdr_msgblock_allocator_ = 0;
00437     }
00438 
00439   if (this->transport_message_buffer_allocator_ != 0)
00440     {
00441       this->transport_message_buffer_allocator_->remove ();
00442       delete this->transport_message_buffer_allocator_;
00443       this->transport_message_buffer_allocator_ = 0;
00444     }
00445 
00446   if (this->output_cdr_dblock_allocator_ != 0)
00447     {
00448       this->output_cdr_dblock_allocator_->remove ();
00449       delete this->output_cdr_dblock_allocator_;
00450       this->output_cdr_dblock_allocator_ = 0;
00451     }
00452 
00453   if (this->output_cdr_buffer_allocator_ != 0)
00454     {
00455       this->output_cdr_buffer_allocator_->remove ();
00456       delete this->output_cdr_buffer_allocator_;
00457       this->output_cdr_buffer_allocator_ = 0;
00458     }
00459 
00460   if (this->output_cdr_msgblock_allocator_ != 0)
00461     {
00462       this->output_cdr_msgblock_allocator_->remove ();
00463       delete this->output_cdr_msgblock_allocator_;
00464       this->output_cdr_msgblock_allocator_ = 0;
00465     }
00466 
00467   if (this->amh_response_handler_allocator_ != 0)
00468     {
00469       this->amh_response_handler_allocator_->remove ();
00470       delete this->amh_response_handler_allocator_;
00471       this->amh_response_handler_allocator_ = 0;
00472     }
00473 
00474   if (this->ami_response_handler_allocator_ != 0)
00475     {
00476       this->ami_response_handler_allocator_->remove ();
00477       delete this->ami_response_handler_allocator_;
00478       this->ami_response_handler_allocator_ = 0;
00479     }
00480 }

int TAO_Thread_Lane_Resources::has_acceptor_registry_been_created ( void   )  const [private]

Checks if the acceptor registry has been created.

Definition at line 61 of file Thread_Lane_Resources.cpp.

References acceptor_registry_.

00062 {
00063   return this->acceptor_registry_ != 0;
00064 }

ACE_Allocator * TAO_Thread_Lane_Resources::input_cdr_buffer_allocator ( void   ) 

Definition at line 197 of file Thread_Lane_Resources.cpp.

References ACE_GUARD_RETURN, TAO_Resource_Factory::input_cdr_buffer_allocator(), input_cdr_buffer_allocator_, resource_factory(), and TAO_SYNCH_MUTEX.

Referenced by TAO_ORB_Core::input_cdr_buffer_allocator().

00198 {
00199   if (this->input_cdr_buffer_allocator_ == 0)
00200     {
00201       // Double checked locking
00202       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
00203 
00204       if (this->input_cdr_buffer_allocator_ == 0)
00205         {
00206           this->input_cdr_buffer_allocator_ =
00207             this->resource_factory ()->input_cdr_buffer_allocator ();
00208         }
00209     }
00210 
00211   return this->input_cdr_buffer_allocator_;
00212 }

ACE_Allocator * TAO_Thread_Lane_Resources::input_cdr_dblock_allocator ( void   ) 

Definition at line 178 of file Thread_Lane_Resources.cpp.

References ACE_GUARD_RETURN, TAO_Resource_Factory::input_cdr_dblock_allocator(), input_cdr_dblock_allocator_, resource_factory(), and TAO_SYNCH_MUTEX.

Referenced by TAO_ORB_Core::input_cdr_dblock_allocator().

00179 {
00180   if (this->input_cdr_dblock_allocator_ == 0)
00181     {
00182       // Double checked locking
00183       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
00184 
00185       if (this->input_cdr_dblock_allocator_ == 0)
00186         {
00187           this->input_cdr_dblock_allocator_ =
00188             this->resource_factory ()->input_cdr_dblock_allocator ();
00189         }
00190     }
00191 
00192   return this->input_cdr_dblock_allocator_;
00193 }

ACE_Allocator * TAO_Thread_Lane_Resources::input_cdr_msgblock_allocator ( void   ) 

Definition at line 216 of file Thread_Lane_Resources.cpp.

References ACE_GUARD_RETURN, TAO_Resource_Factory::input_cdr_msgblock_allocator(), input_cdr_msgblock_allocator_, resource_factory(), and TAO_SYNCH_MUTEX.

Referenced by TAO_ORB_Core::input_cdr_msgblock_allocator().

00217 {
00218   if (this->input_cdr_msgblock_allocator_ == 0)
00219     {
00220       // Double checked locking
00221       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
00222 
00223       if (this->input_cdr_msgblock_allocator_ == 0)
00224         {
00225           this->input_cdr_msgblock_allocator_ =
00226             this->resource_factory ()->input_cdr_msgblock_allocator ();
00227         }
00228     }
00229 
00230   return this->input_cdr_msgblock_allocator_;
00231 }

int TAO_Thread_Lane_Resources::is_collocated ( const TAO_MProfile mprofile  ) 

Definition at line 67 of file Thread_Lane_Resources.cpp.

References acceptor_registry(), and TAO_Acceptor_Registry::is_collocated().

Referenced by TAO_Default_Thread_Lane_Resources_Manager::is_collocated().

00068 {
00069   if (!this->has_acceptor_registry_been_created ())
00070     {
00071       return 0;
00072     }
00073 
00074   return this->acceptor_registry ().is_collocated (mprofile);
00075 }

TAO_Leader_Follower & TAO_Thread_Lane_Resources::leader_follower ( void   ) 

Definition at line 153 of file Thread_Lane_Resources.cpp.

References ACE_GUARD_RETURN, ACE_NEW_RETURN, leader_follower_, and TAO_SYNCH_MUTEX.

Referenced by TAO_ORB_Core::leader_follower(), and shutdown_reactor().

00154 {
00155   // Double check.
00156   if (this->leader_follower_ == 0)
00157     {
00158       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
00159                         ace_mon,
00160                         this->lock_,
00161                         *this->leader_follower_);
00162 
00163       if (this->leader_follower_ == 0)
00164         {
00165           // Create a new Leader Follower object.
00166           ACE_NEW_RETURN (this->leader_follower_,
00167                           TAO_Leader_Follower (&this->orb_core_,
00168                                                this->new_leader_generator_),
00169                           *this->leader_follower_);
00170         }
00171     }
00172 
00173   return *this->leader_follower_;
00174 }

int TAO_Thread_Lane_Resources::open_acceptor_registry ( const TAO_EndpointSet endpoint_set,
bool  ignore_address 
)

Open the acceptor registry.

Definition at line 345 of file Thread_Lane_Resources.cpp.

References acceptor_registry(), and TAO_Acceptor_Registry::open().

Referenced by TAO_Default_Thread_Lane_Resources_Manager::open_default_resources().

00347 {
00348   // Access the acceptor registry.
00349   TAO_Acceptor_Registry &ar = this->acceptor_registry ();
00350 
00351   // Open it.
00352   return ar.open (&this->orb_core_,
00353                   this->leader_follower ().reactor (),
00354                   endpoint_set,
00355                   ignore_address);
00356 }

ACE_Allocator * TAO_Thread_Lane_Resources::output_cdr_buffer_allocator ( void   ) 

Definition at line 272 of file Thread_Lane_Resources.cpp.

References ACE_GUARD_RETURN, TAO_Resource_Factory::output_cdr_buffer_allocator(), output_cdr_buffer_allocator_, resource_factory(), and TAO_SYNCH_MUTEX.

Referenced by TAO_ORB_Core::output_cdr_buffer_allocator().

00273 {
00274   if (this->output_cdr_buffer_allocator_ == 0)
00275     {
00276       // Double checked locking
00277       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
00278 
00279       if (this->output_cdr_buffer_allocator_ == 0)
00280         {
00281           this->output_cdr_buffer_allocator_ =
00282             this->resource_factory ()->output_cdr_buffer_allocator ();
00283         }
00284     }
00285 
00286   return this->output_cdr_buffer_allocator_;
00287 }

ACE_Allocator * TAO_Thread_Lane_Resources::output_cdr_dblock_allocator ( void   ) 

Definition at line 253 of file Thread_Lane_Resources.cpp.

References ACE_GUARD_RETURN, TAO_Resource_Factory::output_cdr_dblock_allocator(), output_cdr_dblock_allocator_, resource_factory(), and TAO_SYNCH_MUTEX.

Referenced by TAO_ORB_Core::output_cdr_dblock_allocator().

00254 {
00255   if (this->output_cdr_dblock_allocator_ == 0)
00256     {
00257       // Double checked locking
00258       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
00259 
00260       if (this->output_cdr_dblock_allocator_ == 0)
00261         {
00262           this->output_cdr_dblock_allocator_ =
00263             this->resource_factory ()->output_cdr_dblock_allocator ();
00264         }
00265     }
00266 
00267   return this->output_cdr_dblock_allocator_;
00268 }

ACE_Allocator * TAO_Thread_Lane_Resources::output_cdr_msgblock_allocator ( void   ) 

Definition at line 291 of file Thread_Lane_Resources.cpp.

References ACE_GUARD_RETURN, TAO_Resource_Factory::output_cdr_msgblock_allocator(), output_cdr_msgblock_allocator_, resource_factory(), and TAO_SYNCH_MUTEX.

Referenced by TAO_ORB_Core::output_cdr_msgblock_allocator().

00292 {
00293   if (this->output_cdr_msgblock_allocator_ == 0)
00294     {
00295       // Double checked locking
00296       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
00297 
00298       if (this->output_cdr_msgblock_allocator_ == 0)
00299         {
00300           this->output_cdr_msgblock_allocator_ =
00301             this->resource_factory ()->output_cdr_msgblock_allocator ();
00302         }
00303     }
00304 
00305   return this->output_cdr_msgblock_allocator_;
00306 }

TAO_Resource_Factory * TAO_Thread_Lane_Resources::resource_factory ( void   )  [private]

Helper to get the resource factory in the ORB_Core.

Definition at line 359 of file Thread_Lane_Resources.cpp.

References orb_core_, and TAO_ORB_Core::resource_factory().

Referenced by acceptor_registry(), amh_response_handler_allocator(), ami_response_handler_allocator(), input_cdr_buffer_allocator(), input_cdr_dblock_allocator(), input_cdr_msgblock_allocator(), output_cdr_buffer_allocator(), output_cdr_dblock_allocator(), output_cdr_msgblock_allocator(), and transport_message_buffer_allocator().

00360 {
00361   return this->orb_core_.resource_factory ();
00362 }

void TAO_Thread_Lane_Resources::shutdown_reactor ( void   ) 

Shutdown the reactor.

Definition at line 483 of file Thread_Lane_Resources.cpp.

References ACE_GUARD, TAO_Leader_Follower::has_clients(), leader_follower(), TAO_Leader_Follower::lock(), TAO_Leader_Follower::reactor(), TAO_SYNCH_MUTEX, and ACE_Reactor::wakeup_all_threads().

Referenced by TAO_Default_Thread_Lane_Resources_Manager::shutdown_reactor().

00484 {
00485   TAO_Leader_Follower &leader_follower = this->leader_follower ();
00486 
00487   ACE_GUARD (TAO_SYNCH_MUTEX,
00488              ace_mon,
00489              leader_follower.lock ());
00490 
00491   ACE_Reactor *reactor = leader_follower.reactor ();
00492 
00493   // Wakeup all the threads waiting blocked in the event loop, this
00494   // does not guarantee that they will all go away, but reduces the
00495   // load on the POA....
00496 
00497   // If there are some client threads running we have to wait until
00498   // they finish, when the last one does it will shutdown the reactor
00499   // for us.  Meanwhile no new requests will be accepted because the
00500   // POA will not process them.
00501   if (!this->orb_core_.resource_factory ()->drop_replies_during_shutdown () &&
00502       leader_follower.has_clients ())
00503     {
00504       reactor->wakeup_all_threads ();
00505       return;
00506     }
00507 
00508   // End the reactor if we want shutdown dropping replies along the
00509   // way.
00510   reactor->end_reactor_event_loop ();
00511 }

TAO::Transport_Cache_Manager & TAO_Thread_Lane_Resources::transport_cache ( void   ) 

Definition at line 55 of file Thread_Lane_Resources.cpp.

References transport_cache_.

Referenced by TAO_IIOP_Connection_Handler::add_transport_to_cache(), TAO_Connector::connect(), TAO::Profile_Transport_Resolver::find_transport(), TAO_Creation_Strategy< SVC_HANDLER >::make_svc_handler(), TAO_Connector::parallel_connect(), and TAO_Transport::transport_cache_manager().

00056 {
00057   return *this->transport_cache_;
00058 }

ACE_Allocator * TAO_Thread_Lane_Resources::transport_message_buffer_allocator ( void   ) 

Definition at line 234 of file Thread_Lane_Resources.cpp.

References ACE_GUARD_RETURN, TAO_Resource_Factory::input_cdr_dblock_allocator(), resource_factory(), TAO_SYNCH_MUTEX, and transport_message_buffer_allocator_.

Referenced by TAO_ORB_Core::transport_message_buffer_allocator().

00235 {
00236   if (this->transport_message_buffer_allocator_ == 0)
00237     {
00238       // Double checked locking
00239       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
00240 
00241       if (this->transport_message_buffer_allocator_ == 0)
00242         {
00243           this->transport_message_buffer_allocator_ =
00244             this->resource_factory ()->input_cdr_dblock_allocator ();
00245         }
00246     }
00247 
00248   return this->transport_message_buffer_allocator_;
00249 }


Member Data Documentation

TAO_Acceptor_Registry* TAO_Thread_Lane_Resources::acceptor_registry_ [private]

The registry which maintains a list of acceptor factories for each loaded protocol.

Definition at line 160 of file Thread_Lane_Resources.h.

Referenced by acceptor_registry(), finalize(), and has_acceptor_registry_been_created().

ACE_Allocator* TAO_Thread_Lane_Resources::amh_response_handler_allocator_ [private]

Definition at line 199 of file Thread_Lane_Resources.h.

Referenced by amh_response_handler_allocator(), and finalize().

ACE_Allocator* TAO_Thread_Lane_Resources::ami_response_handler_allocator_ [private]

Definition at line 204 of file Thread_Lane_Resources.h.

Referenced by ami_response_handler_allocator(), and finalize().

TAO_Connector_Registry* TAO_Thread_Lane_Resources::connector_registry_ [private]

The connector registry which all active connectors must register themselves with.

Definition at line 164 of file Thread_Lane_Resources.h.

Referenced by connector_registry(), and finalize().

ACE_Allocator* TAO_Thread_Lane_Resources::input_cdr_buffer_allocator_ [private]

Definition at line 181 of file Thread_Lane_Resources.h.

Referenced by finalize(), and input_cdr_buffer_allocator().

ACE_Allocator* TAO_Thread_Lane_Resources::input_cdr_dblock_allocator_ [private]

Definition at line 180 of file Thread_Lane_Resources.h.

Referenced by finalize(), and input_cdr_dblock_allocator().

ACE_Allocator* TAO_Thread_Lane_Resources::input_cdr_msgblock_allocator_ [private]

Definition at line 182 of file Thread_Lane_Resources.h.

Referenced by finalize(), and input_cdr_msgblock_allocator().

TAO_Leader_Follower* TAO_Thread_Lane_Resources::leader_follower_ [private]

The leader/followers management class for this lane.

Definition at line 170 of file Thread_Lane_Resources.h.

Referenced by finalize(), and leader_follower().

TAO_SYNCH_MUTEX TAO_Thread_Lane_Resources::lock_ [private]

Synchronization.

Definition at line 173 of file Thread_Lane_Resources.h.

TAO_New_Leader_Generator* TAO_Thread_Lane_Resources::new_leader_generator_ [private]

Generator of new leader threads.

Definition at line 176 of file Thread_Lane_Resources.h.

TAO_ORB_Core& TAO_Thread_Lane_Resources::orb_core_ [private]

ORB_Core related to this thread lane.

Definition at line 156 of file Thread_Lane_Resources.h.

Referenced by acceptor_registry(), connector_registry(), and resource_factory().

ACE_Allocator* TAO_Thread_Lane_Resources::output_cdr_buffer_allocator_ [private]

Definition at line 193 of file Thread_Lane_Resources.h.

Referenced by finalize(), and output_cdr_buffer_allocator().

ACE_Allocator* TAO_Thread_Lane_Resources::output_cdr_dblock_allocator_ [private]

Definition at line 192 of file Thread_Lane_Resources.h.

Referenced by finalize(), and output_cdr_dblock_allocator().

ACE_Allocator* TAO_Thread_Lane_Resources::output_cdr_msgblock_allocator_ [private]

Definition at line 194 of file Thread_Lane_Resources.h.

Referenced by finalize(), and output_cdr_msgblock_allocator().

TAO::Transport_Cache_Manager* TAO_Thread_Lane_Resources::transport_cache_ [private]

Transport cache.

Definition at line 167 of file Thread_Lane_Resources.h.

Referenced by cleanup_rw_transports(), finalize(), and transport_cache().

ACE_Allocator* TAO_Thread_Lane_Resources::transport_message_buffer_allocator_ [private]

Definition at line 187 of file Thread_Lane_Resources.h.

Referenced by finalize(), and transport_message_buffer_allocator().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:39:47 2010 for TAO by  doxygen 1.4.7