diff options
Diffstat (limited to 'TAO/tao/Strategies/SHMIOP_Connector.cpp')
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Connector.cpp | 114 |
1 files changed, 48 insertions, 66 deletions
diff --git a/TAO/tao/Strategies/SHMIOP_Connector.cpp b/TAO/tao/Strategies/SHMIOP_Connector.cpp index e2bf964478a..244f74250f4 100644 --- a/TAO/tao/Strategies/SHMIOP_Connector.cpp +++ b/TAO/tao/Strategies/SHMIOP_Connector.cpp @@ -1,6 +1,7 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ + #include "SHMIOP_Connector.h" #if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0) @@ -16,38 +17,9 @@ ACE_RCSID(Strategies, SHMIOP_Connector, "$Id$") -TAO_SHMIOP_Connect_Creation_Strategy:: - TAO_SHMIOP_Connect_Creation_Strategy (ACE_Thread_Manager* t, - TAO_ORB_Core *orb_core, - CORBA::Boolean flag) - : ACE_Creation_Strategy<TAO_SHMIOP_Client_Connection_Handler> (t), - orb_core_ (orb_core), - lite_flag_ (flag) -{ -} - -TAO_SHMIOP_Connect_Creation_Strategy:: - ~TAO_SHMIOP_Connect_Creation_Strategy (void) -{ -} - -int -TAO_SHMIOP_Connect_Creation_Strategy::make_svc_handler - (TAO_SHMIOP_Client_Connection_Handler *&sh) -{ - if (sh == 0) - ACE_NEW_RETURN (sh, - TAO_SHMIOP_Client_Connection_Handler - (this->orb_core_->thr_mgr (), - this->orb_core_), - -1); - return 0; -} - -// **************************************************************** - TAO_SHMIOP_Connector::TAO_SHMIOP_Connector (CORBA::Octet flag) : TAO_Connector (TAO_TAG_SHMEM_PROFILE), + connect_strategy_ (), base_connector_ (), lite_flag_ (flag) { @@ -63,25 +35,34 @@ TAO_SHMIOP_Connector::open (TAO_ORB_Core *orb_core) { this->orb_core (orb_core); - TAO_SHMIOP_Connect_Creation_Strategy *connect_creation_strategy = 0; + // Our connect creation strategy + TAO_SHMIOP_CONNECT_CREATION_STRATEGY *connect_creation_strategy = 0; ACE_NEW_RETURN (connect_creation_strategy, - TAO_SHMIOP_Connect_Creation_Strategy - (this->orb_core ()->thr_mgr (), - this->orb_core (), - this->lite_flag_), + TAO_SHMIOP_CONNECT_CREATION_STRATEGY + (orb_core->thr_mgr (), + orb_core, + 0, + this->lite_flag_), -1); + /// Our activation strategy + TAO_SHMIOP_CONNECT_CONCURRENCY_STRATEGY *concurrency_strategy = 0; + + ACE_NEW_RETURN (concurrency_strategy, + TAO_SHMIOP_CONNECT_CONCURRENCY_STRATEGY (orb_core), + -1); return this->base_connector_.open (this->orb_core ()->reactor (), connect_creation_strategy, &this->connect_strategy_, - &this->null_activation_strategy_); + concurrency_strategy); } int TAO_SHMIOP_Connector::close (void) { + delete this->base_connector_.concurrency_strategy (); delete this->base_connector_.creation_strategy (); return this->base_connector_.close (); } @@ -130,7 +111,7 @@ TAO_SHMIOP_Connector::connect (TAO_Connection_Descriptor_Interface *desc, } int result = 0; - TAO_SHMIOP_Client_Connection_Handler *svc_handler = 0; + TAO_SHMIOP_Connection_Handler *svc_handler = 0; TAO_Connection_Handler *conn_handler = 0; // Check the Cache first for connections @@ -144,7 +125,7 @@ TAO_SHMIOP_Connector::connect (TAO_Connection_Descriptor_Interface *desc, // We have found a connection and a handler svc_handler = - ACE_dynamic_cast (TAO_SHMIOP_Client_Connection_Handler *, + ACE_dynamic_cast (TAO_SHMIOP_Connection_Handler *, conn_handler); } else @@ -301,7 +282,7 @@ TAO_SHMIOP_Connector::preconnect (const char *preconnects) // array of eventual handlers. num_connections = dests.size (); ACE_INET_Addr *remote_addrs = 0; - TAO_SHMIOP_Client_Connection_Handler **handlers = 0; + TAO_SHMIOP_Connection_Handler **handlers = 0; char *failures = 0; ACE_NEW_RETURN (remote_addrs, @@ -311,10 +292,10 @@ TAO_SHMIOP_Connector::preconnect (const char *preconnects) ACE_Auto_Basic_Array_Ptr<ACE_INET_Addr> safe_remote_addrs (remote_addrs); ACE_NEW_RETURN (handlers, - TAO_SHMIOP_Client_Connection_Handler *[num_connections], + TAO_SHMIOP_Connection_Handler *[num_connections], -1); - ACE_Auto_Basic_Array_Ptr<TAO_SHMIOP_Client_Connection_Handler*> + ACE_Auto_Basic_Array_Ptr<TAO_SHMIOP_Connection_Handler*> safe_handlers (handlers); ACE_NEW_RETURN (failures, @@ -462,35 +443,36 @@ TAO_SHMIOP_Connector::object_key_delimiter (void) const #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Concurrency_Strategy<TAO_SHMIOP_Client_Connection_Handler>; -template class ACE_Creation_Strategy<TAO_SHMIOP_Client_Connection_Handler>; -template class ACE_Strategy_Connector<TAO_SHMIOP_Client_Connection_Handler, ACE_MEM_CONNECTOR>; -template class ACE_Connect_Strategy<TAO_SHMIOP_Client_Connection_Handler, ACE_MEM_CONNECTOR>; -template class ACE_Connector<TAO_SHMIOP_Client_Connection_Handler, ACE_MEM_CONNECTOR>; -template class ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler>; +template class TAO_Connect_Concurrency_Strategy<TAO_SHMIOP_Connection_Handler>; +template class TAO_Connect_Creation_Strategy<TAO_SHMIOP_Connection_Handler>; +template class ACE_Strategy_Connector<TAO_SHMIOP_Connection_Handler, ACE_MEM_CONNECTOR>; +template class ACE_Connect_Strategy<TAO_SHMIOP_Connection_Handler, ACE_MEM_CONNECTOR>; +template class ACE_Connector<TAO_SHMIOP_Connection_Handler, ACE_MEM_CONNECTOR>; +template class ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>; -template class ACE_Map_Manager<int, ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator_Base<int, ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Entry<int,ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler>*>; -template class ACE_Map_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler>*,ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Reverse_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler>*,ACE_SYNCH_RW_MUTEX>; -template class ACE_Auto_Basic_Array_Ptr<TAO_SHMIOP_Client_Connection_Handler*>; +template class ACE_Map_Manager<int, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator_Base<int, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Entry<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*>; +template class ACE_Map_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Reverse_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,ACE_SYNCH_RW_MUTEX>; +template class ACE_Auto_Basic_Array_Ptr<TAO_SHMIOP_Connection_Handler*>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Concurrency_Strategy<TAO_SHMIOP_Client_Connection_Handler> -#pragma instantiate ACE_Strategy_Connector<TAO_SHMIOP_Client_Connection_Handler, ACE_MEM_CONNECTOR> -#pragma instantiate ACE_Connect_Strategy<TAO_SHMIOP_Client_Connection_Handler, ACE_MEM_CONNECTOR> - -#pragma instantiate ACE_Connector<TAO_SHMIOP_Client_Connection_Handler, ACE_MEM_Connector> -#pragma instantiate ACE_Creation_Strategy<TAO_SHMIOP_Client_Connection_Handler> -#pragma instantiate ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler> -#pragma instantiate ACE_Map_Manager<int, ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator_Base<int, ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Entry<int,ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler>*> -#pragma instantiate ACE_Map_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler>*,ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Reverse_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Client_Connection_Handler>*,ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Auto_Basic_Array_Ptr<TAO_SHMIOP_Client_Connection_Handler*> +#pragma instantiate TAO_Connect_Concurrency_Strategy<TAO_SHMIOP_Connection_Handler>; +#pragma instantiate TAO_Connect_Creation_Strategy<TAO_SHMIOP_Connection_Handler>; +#pragma instantiate ACE_Strategy_Connector<TAO_SHMIOP_Connection_Handler, ACE_MEM_CONNECTOR>; +#pragma instantiate ACE_Connect_Strategy<TAO_SHMIOP_Connection_Handler, ACE_MEM_CONNECTOR>; +#pragma instantiate ACE_Connector<TAO_SHMIOP_Connection_Handler, ACE_MEM_CONNECTOR>; +#pragma instantiate ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>; + +#pragma instantiate ACE_Map_Manager<int, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator_Base<int, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Entry<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*> +#pragma instantiate ACE_Map_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Reverse_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Auto_Basic_Array_Ptr<TAO_SHMIOP_Connection_Handler*> + #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ |