summaryrefslogtreecommitdiff
path: root/ace/Cached_Connect_Strategy_T.h
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-06-04 20:22:26 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-06-04 20:22:26 +0000
commitee92b3a62fb18b061e622025d703c72ff54a340c (patch)
tree9ff7b1ad8b4c7aa22bc8276abb2b15f685c9687e /ace/Cached_Connect_Strategy_T.h
parent13d08ad10b3dd07c5adfcdea5160841985a13149 (diff)
downloadATCD-ee92b3a62fb18b061e622025d703c72ff54a340c.tar.gz
Removed common code by inheriting form Cached_Connect_Strategy
Diffstat (limited to 'ace/Cached_Connect_Strategy_T.h')
-rw-r--r--ace/Cached_Connect_Strategy_T.h107
1 files changed, 4 insertions, 103 deletions
diff --git a/ace/Cached_Connect_Strategy_T.h b/ace/Cached_Connect_Strategy_T.h
index f6c76d3ce15..4a6263faed7 100644
--- a/ace/Cached_Connect_Strategy_T.h
+++ b/ace/Cached_Connect_Strategy_T.h
@@ -29,8 +29,7 @@
#include "ace/Synch.h"
template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class MUTEX>
-class ACE_Cached_Connect_Strategy_Ex : public ACE_Connection_Recycling_Strategy,
- public ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>
+class ACE_Cached_Connect_Strategy_Ex : public ACE_Cached_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>
{
// = TITLE
// A connection strategy which caches connections to peers
@@ -47,7 +46,9 @@ public:
ACE_Cached_Connect_Strategy_Ex (ACE_Creation_Strategy<SVC_HANDLER> *cre_s = 0,
ACE_Concurrency_Strategy<SVC_HANDLER> *con_s = 0,
- ACE_Recycling_Strategy<SVC_HANDLER> *rec_s = 0);
+ ACE_Recycling_Strategy<SVC_HANDLER> *rec_s = 0,
+ MUTEX *mutex = 0,
+ int delete_mutex = 0);
// Constructor
virtual ~ACE_Cached_Connect_Strategy_Ex (void);
@@ -60,22 +61,6 @@ public:
// This methods allow you to change the strategies used by the
// cached connector.
- virtual int make_svc_handler (SVC_HANDLER *&sh);
- // Template method for making a new <svc_handler>
-
- virtual int activate_svc_handler (SVC_HANDLER *svc_handler);
- // Template method for activating a new <svc_handler>
-
- virtual int assign_recycler (SVC_HANDLER *svc_handler,
- ACE_Connection_Recycling_Strategy *recycler,
- const void *recycling_act);
- // Template method for setting the recycler information of the
- // svc_handler.
-
-
- virtual int prepare_for_recycling (SVC_HANDLER *svc_handler);
- // Template method for preparing the svc_handler for recycling.
-
virtual int connect (SVC_HANDLER *&sh,
const ACE_PEER_CONNECTOR_ADDR &remote_addr,
ACE_Time_Value *timeout,
@@ -91,58 +76,6 @@ public:
// the descriptors which get used in the connect process and hence
// the connect operation can succeed.
- virtual int 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 int 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);
- // 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.
-
- virtual int purge (const void *recycling_act);
- // Remove from cache.
-
- virtual int cache (const void *recycling_act);
- // Add to cache.
-
- virtual int mark_as_closed (const void *recycling_act);
- // Mark as closed.
-
- virtual int cleanup_hint (const void *recycling_act);
-
- // Cleanup hint.
-
- // = Define some useful typedefs.
- typedef ACE_Creation_Strategy<SVC_HANDLER>
- CREATION_STRATEGY;
- typedef ACE_Concurrency_Strategy<SVC_HANDLER>
- CONCURRENCY_STRATEGY;
- typedef ACE_Recycling_Strategy<SVC_HANDLER>
- RECYCLING_STRATEGY;
-
- // = Super class
- typedef ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>
- CONNECT_STRATEGY;
-
// = Typedefs for managing the map
typedef ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>
REFCOUNTED_HASH_RECYCLABLE_ADDRESS;
@@ -162,11 +95,6 @@ public:
typedef ACE_Svc_Cleanup_Strategy<ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDRESS, ACE_Pair<SVC_HANDLER *, ATTRIBUTES>, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, MUTEX> >
SVC_CLEANUP_STRATEGY;
- // = Strategy accessors
- virtual ACE_Creation_Strategy<SVC_HANDLER> *creation_strategy (void) const;
- virtual ACE_Recycling_Strategy<SVC_HANDLER> *recycling_strategy (void) const;
- virtual ACE_Concurrency_Strategy<SVC_HANDLER> *concurrency_strategy (void) const;
-
protected:
virtual int purge_i (const void *recycling_act);
@@ -198,7 +126,6 @@ protected:
const ACE_PEER_CONNECTOR_ADDR &local_addr,
int reuse_addr,
int flags,
-
int perms,
int &found);
@@ -215,32 +142,6 @@ protected:
CONNECTION_CACHE connection_cache_;
// Table that maintains the cache of connected <SVC_HANDLER>s.
- MUTEX lock_;
- // Mutual exclusion for this object.
-
- // = Strategy objects.
-
- CREATION_STRATEGY *creation_strategy_;
- // Creation strategy for an <Connector>.
-
- int delete_creation_strategy_;
- // 1 if <Connector> created the creation strategy and thus should
- // delete it, else 0.
-
- CONCURRENCY_STRATEGY *concurrency_strategy_;
- // Concurrency strategy for an <Connector>.
-
- int delete_concurrency_strategy_;
- // 1 if <Connector> created the concurrency strategy and thus should
- // delete it, else 0.
-
- RECYCLING_STRATEGY *recycling_strategy_;
- // Recycling strategy for an <Connector>.
-
- int delete_recycling_strategy_;
- // 1 if <Connector> created the recycling strategy and thus should
- // delete it, else 0.
-
SVC_CLEANUP_STRATEGY *svc_cleanup_strategy_;
// The strategy which controls the destruction and closing of the
// svc_handler.