ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX > Class Template ReferenceA connection strategy which caches connections to peers (represented by SVC_HANDLER instances), thereby allowing subsequent re-use of unused, but available, connections. More...
Inheritance diagram for ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >:
![]()
Collaboration diagram for ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >:
![]()
Detailed Descriptiontemplate<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX>
A connection strategy which caches connections to peers (represented by SVC_HANDLER instances), thereby allowing subsequent re-use of unused, but available, connections.
|
typedef ACE_Creation_Strategy<SVC_HANDLER> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::creation_strategy_type |
typedef ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::connect_strategy_type |
typedef ACE_Concurrency_Strategy<SVC_HANDLER> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::concurrency_strategy_type |
typedef ACE_Recycling_Strategy<SVC_HANDLER> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::recycling_strategy_type |
typedef ACE_Creation_Strategy<SVC_HANDLER> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::CREATION_STRATEGY |
typedef ACE_Concurrency_Strategy<SVC_HANDLER> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::CONCURRENCY_STRATEGY |
typedef ACE_Recycling_Strategy<SVC_HANDLER> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::RECYCLING_STRATEGY |
typedef ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::CONNECT_STRATEGY |
typedef ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::SELF |
typedef ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::REFCOUNTED_HASH_RECYCLABLE_ADDRESS |
Reimplemented in ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >, ACE_Bounded_Cached_Connect_Strategy< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >, and ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX >.
typedef ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDRESS, SVC_HANDLER *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, ACE_Null_Mutex> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::CONNECTION_MAP |
typedef CONNECTION_MAP::ITERATOR ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::CONNECTION_MAP_ITERATOR |
typedef CONNECTION_MAP::ENTRY ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::CONNECTION_MAP_ENTRY |
typedef ACE_Reverse_Lock<MUTEX> ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::REVERSE_MUTEX |
ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::ACE_Cached_Connect_Strategy | ( | ACE_Creation_Strategy< SVC_HANDLER > * | cre_s = 0 , |
|
ACE_Concurrency_Strategy< SVC_HANDLER > * | con_s = 0 , |
|||
ACE_Recycling_Strategy< SVC_HANDLER > * | rec_s = 0 , |
|||
MUTEX * | mutex = 0 , |
|||
bool | delete_lock = false | |||
) |
Constructor.
virtual ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::~ACE_Cached_Connect_Strategy | ( | void | ) | [virtual] |
Destructor.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::open | ( | ACE_Creation_Strategy< SVC_HANDLER > * | cre_s, | |
ACE_Concurrency_Strategy< SVC_HANDLER > * | con_s, | |||
ACE_Recycling_Strategy< SVC_HANDLER > * | rec_s | |||
) | [virtual] |
This methods allow you to change the strategies used by the cached connector.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::make_svc_handler | ( | SVC_HANDLER *& | sh | ) | [virtual] |
Template method for making a new <svc_handler>.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::activate_svc_handler | ( | SVC_HANDLER * | svc_handler | ) | [virtual] |
Template method for activating a new <svc_handler>.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::assign_recycler | ( | SVC_HANDLER * | svc_handler, | |
ACE_Connection_Recycling_Strategy * | recycler, | |||
const void * | recycling_act | |||
) | [virtual] |
Template method for setting the recycler information of the svc_handler.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::prepare_for_recycling | ( | SVC_HANDLER * | svc_handler | ) | [virtual] |
Template method for preparing the svc_handler for recycling.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::connect_svc_handler | ( | SVC_HANDLER *& | sh, | |
const ACE_PEER_CONNECTOR_ADDR & | remote_addr, | |||
ACE_Time_Value * | timeout, | |||
const ACE_PEER_CONNECTOR_ADDR & | local_addr, | |||
int | reuse_addr, | |||
int | flags, | |||
int | perms | |||
) | [virtual] |
Checks to see if there is already a <SVC_HANDLER> in the cache connected to the <remote_addr>. If so, we return this pointer. Otherwise we establish the connection, put it into the cache, and return the SVC_HANDLER pointer. <[NOTE]>: the <{reuse_addr}> argument does NOT control re-use of addresses in the cache. Rather, if the underlying protocol requires a "dead time" prior to re-use of its addresses (TCP is a classic example of this), <{and}> the protocol provides a means by which to defeat the dead time, setting this argument to non-zero will defeat the dead-time requirement. <{Dev. Note: We might want to consider enhancing the interface at some point so that this also controls re-use of the cache.}>
Reimplemented from ACE_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::connect_svc_handler | ( | SVC_HANDLER *& | sh, | |
SVC_HANDLER *& | sh_copy, | |||
const ACE_PEER_CONNECTOR_ADDR & | remote_addr, | |||
ACE_Time_Value * | timeout, | |||
const ACE_PEER_CONNECTOR_ADDR & | local_addr, | |||
int | reuse_addr, | |||
int | flags, | |||
int | perms | |||
) | [virtual] |
The default behavior delegates to the <connect> method of the <PEER_CONNECTOR::connect>. Please check the documentation in Connector.h for more details.
Reimplemented from ACE_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::purge | ( | const void * | recycling_act | ) | [virtual] |
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::cache | ( | const void * | recycling_act | ) | [virtual] |
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::recycle_state | ( | const void * | recycling_act, | |
ACE_Recyclable_State | new_state | |||
) | [virtual] |
virtual ACE_Recyclable_State ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::recycle_state | ( | const void * | recycling_act | ) | const [virtual] |
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::mark_as_closed | ( | const void * | recycling_act | ) | [virtual] |
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::mark_as_closed_i | ( | const void * | recycling_act | ) | [virtual] |
Mark as closed (non-locking version). This method needs to be public as it is used in the cleanup of handlers where teh locked version causes a deadlock.
Implements ACE_Connection_Recycling_Strategy.
Reimplemented in ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >, and ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX >.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::cleanup_hint | ( | const void * | recycling_act, | |
void ** | act_holder = 0 | |||
) | [virtual] |
Cleanup hint and reset <*act_holder> to zero if <act_holder != 0>.
Implements ACE_Connection_Recycling_Strategy.
virtual ACE_Creation_Strategy<SVC_HANDLER>* ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::creation_strategy | ( | void | ) | const [virtual] |
virtual ACE_Recycling_Strategy<SVC_HANDLER>* ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::recycling_strategy | ( | void | ) | const [virtual] |
virtual ACE_Concurrency_Strategy<SVC_HANDLER>* ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::concurrency_strategy | ( | void | ) | const [virtual] |
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::new_connection | ( | SVC_HANDLER *& | sh, | |
const ACE_PEER_CONNECTOR_ADDR & | remote_addr, | |||
ACE_Time_Value * | timeout, | |||
const ACE_PEER_CONNECTOR_ADDR & | local_addr, | |||
int | reuse_addr, | |||
int | flags, | |||
int | perms | |||
) | [protected, virtual] |
Creates a new connection.
int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::find | ( | REFCOUNTED_HASH_RECYCLABLE_ADDRESS & | search_addr, | |
CONNECTION_MAP_ENTRY *& | entry | |||
) | [protected] |
Find an idle handle.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::purge_i | ( | const void * | recycling_act | ) | [protected, virtual] |
Remove from cache (non-locking version).
Reimplemented in ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >, and ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX >.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::cache_i | ( | const void * | recycling_act | ) | [protected, virtual] |
Add to cache (non-locking version).
Reimplemented in ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >, and ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX >.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::recycle_state_i | ( | const void * | recycling_act, | |
ACE_Recyclable_State | new_state | |||
) | [protected, virtual] |
Set <recycle_state> (non-locking version).
Reimplemented in ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >, and ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX >.
virtual ACE_Recyclable_State ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::recycle_state_i | ( | const void * | recycling_act | ) | const [protected, virtual] |
Get <recycle_state> (non-locking version).
Reimplemented in ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >, and ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX >.
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::cleanup_hint_i | ( | const void * | recycling_act, | |
void ** | act_holder | |||
) | [protected, virtual] |
Cleanup hint and reset <*act_holder> to zero if <act_holder != 0>.
Reimplemented in ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >, and ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX >.
int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::check_hint_i | ( | SVC_HANDLER *& | sh, | |
const ACE_PEER_CONNECTOR_ADDR & | remote_addr, | |||
ACE_Time_Value * | timeout, | |||
const ACE_PEER_CONNECTOR_ADDR & | local_addr, | |||
int | reuse_addr, | |||
int | flags, | |||
int | perms, | |||
CONNECTION_MAP_ENTRY *& | entry, | |||
int & | found | |||
) | [protected] |
int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::find_or_create_svc_handler_i | ( | SVC_HANDLER *& | sh, | |
const ACE_PEER_CONNECTOR_ADDR & | remote_addr, | |||
ACE_Time_Value * | timeout, | |||
const ACE_PEER_CONNECTOR_ADDR & | local_addr, | |||
int | reuse_addr, | |||
int | flags, | |||
int | perms, | |||
CONNECTION_MAP_ENTRY *& | entry, | |||
int & | found | |||
) | [protected] |
virtual int ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::connect_svc_handler_i | ( | SVC_HANDLER *& | sh, | |
const ACE_PEER_CONNECTOR_ADDR & | remote_addr, | |||
ACE_Time_Value * | timeout, | |||
const ACE_PEER_CONNECTOR_ADDR & | local_addr, | |||
int | reuse_addr, | |||
int | flags, | |||
int | perms, | |||
int & | found | |||
) | [protected, virtual] |
CONNECTION_MAP ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::connection_map_ [protected] |
Table that maintains the cache of connected SVC_HANDLERs.
MUTEX* ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::lock_ [protected] |
Mutual exclusion for this object.
bool ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::delete_lock_ [protected] |
Mutual exclusion for this object.
REVERSE_MUTEX* ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::reverse_lock_ [protected] |
Reverse lock.
CREATION_STRATEGY* ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::creation_strategy_ [protected] |
Creation strategy for an <Connector>.
bool ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::delete_creation_strategy_ [protected] |
true if <Connector> created the creation strategy and thus should delete it, else false.
CONCURRENCY_STRATEGY* ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::concurrency_strategy_ [protected] |
Concurrency strategy for an <Connector>.
bool ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::delete_concurrency_strategy_ [protected] |
true if <Connector> created the concurrency strategy and thus should delete it, else false.
RECYCLING_STRATEGY* ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::recycling_strategy_ [protected] |
Recycling strategy for an <Connector>.
bool ACE_Cached_Connect_Strategy< SVC_HANDLER,, MUTEX >::delete_recycling_strategy_ [protected] |
true if <Connector> created the recycling strategy and thus should delete it, else false.