summaryrefslogtreecommitdiff
path: root/tests/Cached_Conn_Test.cpp
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-07 20:44:08 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-07 20:44:08 +0000
commit83b908163702c6573fbf333f3ccb1661a57e12ac (patch)
tree59331593d08214921e1b9fd3e77d3f7dbab00166 /tests/Cached_Conn_Test.cpp
parent1023c4d4aedd226a90ce23168946ac83d640232d (diff)
downloadATCD-83b908163702c6573fbf333f3ccb1661a57e12ac.tar.gz
Added the run-time selection of strategies feature
Diffstat (limited to 'tests/Cached_Conn_Test.cpp')
-rw-r--r--tests/Cached_Conn_Test.cpp451
1 files changed, 208 insertions, 243 deletions
diff --git a/tests/Cached_Conn_Test.cpp b/tests/Cached_Conn_Test.cpp
index c8e5adc069a..fe4738f53c2 100644
--- a/tests/Cached_Conn_Test.cpp
+++ b/tests/Cached_Conn_Test.cpp
@@ -47,7 +47,7 @@ USELIB("..\ace\aced.lib");
// Default number of clients/servers.
static int n_servers = 2000;
static double purge_percentage = 20;
-static int caching_strategy_type = 0;
+static int caching_strategy_type = 1;
typedef size_t ATTRIBUTES;
typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
@@ -72,204 +72,209 @@ typedef ACE_Svc_Cleanup_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER
CLEANUP_STRATEGY;
typedef ACE_Pair_Caching_Utility<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES>
CACHING_UTILITY;
-
-typedef ACE_LRU_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
+
+typedef ACE_Caching_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
+ CACHING_STRATEGY;
+typedef ACE_LRU_Caching_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
LRU_CACHING_STRATEGY;
-typedef ACE_LFU_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
+typedef ACE_LFU_Caching_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
LFU_CACHING_STRATEGY;
-typedef ACE_FIFO_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
+typedef ACE_FIFO_Caching_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
FIFO_CACHING_STRATEGY;
-typedef ACE_Null_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
+typedef ACE_Null_Caching_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
NULL_CACHING_STRATEGY;
-
-//====================================================================
-
-template <class CACHING_STRATEGY>
-class Connection_Management
-{
-public:
-
- typedef ACE_Oneshot_Acceptor<Svc_Handler, ACE_SOCK_ACCEPTOR>
- ACCEPTOR;
+typedef ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY >
+ LRU_CACHING_STRATEGY_ADAPTER;
+typedef ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY>
+ LFU_CACHING_STRATEGY_ADAPTER;
+typedef ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY>
+ FIFO_CACHING_STRATEGY_ADAPTER;
+typedef ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY>
+ NULL_CACHING_STRATEGY_ADAPTER;
+
+typedef ACE_Oneshot_Acceptor<Svc_Handler, ACE_SOCK_ACCEPTOR>
+ ACCEPTOR;
- typedef ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>
- STRATEGY_CONNECTOR;
+typedef ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>
+ STRATEGY_CONNECTOR;
- typedef ACE_NOOP_Creation_Strategy<Svc_Handler>
- NULL_CREATION_STRATEGY;
+typedef ACE_NOOP_Creation_Strategy<Svc_Handler>
+ NULL_CREATION_STRATEGY;
- typedef ACE_NOOP_Concurrency_Strategy<Svc_Handler>
- NULL_ACTIVATION_STRATEGY;
+typedef ACE_NOOP_Concurrency_Strategy<Svc_Handler>
+ NULL_ACTIVATION_STRATEGY;
- typedef ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>
- CACHED_CONNECT_STRATEGY;
+typedef ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>
+ CACHED_CONNECT_STRATEGY;
- int
- cached_connect (STRATEGY_CONNECTOR &con,
- const ACE_INET_Addr &server_addr)
- {
- Svc_Handler *svc_handler = 0;
-
- // Perform a blocking connect to the server using the Strategy
- // Connector with a connection caching strategy. Since we are
- // connecting to the same <server_addr> these calls will return
- // the same dynamically allocated <Svc_Handler> for each
- // <connect>.
- int result = con.connect (svc_handler,
- server_addr);
- if (result == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%P|%t) %p\n"),
- ASYS_TEXT ("connection failed")),
- -1);
+//====================================================================
+
+
+static int
+cached_connect (STRATEGY_CONNECTOR &con,
+ const ACE_INET_Addr &server_addr)
+{
+ Svc_Handler *svc_handler = 0;
+
+ // Perform a blocking connect to the server using the Strategy
+ // Connector with a connection caching strategy. Since we are
+ // connecting to the same <server_addr> these calls will return
+ // the same dynamically allocated <Svc_Handler> for each
+ // <connect>.
+ int result = con.connect (svc_handler,
+ server_addr);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("(%P|%t) %p\n"),
+ ASYS_TEXT ("connection failed")),
+ -1);
- // Send the data to the server.
- for (char *c = ACE_ALPHABET; *c != '\0'; c++)
- if (svc_handler->peer ().send_n (c, 1) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%P|%t) %p\n"),
- ASYS_TEXT ("send_n")),
- -1);
+ // Send the data to the server.
+ for (char *c = ACE_ALPHABET; *c != '\0'; c++)
+ if (svc_handler->peer ().send_n (c, 1) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("(%P|%t) %p\n"),
+ ASYS_TEXT ("send_n")),
+ -1);
- // Svc_Handler is now idle, so mark it as such and let the cache
- // recycle it.
- svc_handler->idle (1);
- return 0;
- }
+ // Svc_Handler is now idle, so mark it as such and let the cache
+ // recycle it.
+ svc_handler->idle (1);
+ return 0;
+}
- int
- server (ACCEPTOR *acceptor)
- {
- ACE_INET_Addr cli_addr;
+static int
+server (ACCEPTOR *acceptor)
+{
+ ACE_INET_Addr cli_addr;
- // Create a new <Svc_Handler> to consume the data.
- Svc_Handler svc_handler;
+ // Create a new <Svc_Handler> to consume the data.
+ Svc_Handler svc_handler;
- int result = acceptor->accept (&svc_handler,
- &cli_addr);
- if (result == -1)
- {
- if (errno == EMFILE)
- return 1;
+ int result = acceptor->accept (&svc_handler,
+ &cli_addr);
+ if (result == -1)
+ {
+ if (errno == EMFILE)
+ return 1;
- return -1;
- }
+ return -1;
+ }
- ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("(%P|%t) client %s connected from %d\n"),
- cli_addr.get_host_name (),
- cli_addr.get_port_number ()));
+ ACE_DEBUG ((LM_DEBUG,
+ ASYS_TEXT ("(%P|%t) client %s connected from %d\n"),
+ cli_addr.get_host_name (),
+ cli_addr.get_port_number ()));
- char c;
- char *t = ACE_ALPHABET;
- ssize_t r_bytes = 0;
+ char c;
+ char *t = ACE_ALPHABET;
+ ssize_t r_bytes = 0;
- // Read data from client (terminate on error).
- while ((r_bytes == svc_handler.peer ().recv_n (&c, 1)) > 0)
- {
- ACE_ASSERT (*t == c);
+ // Read data from client (terminate on error).
+ while ((r_bytes == svc_handler.peer ().recv_n (&c, 1)) > 0)
+ {
+ ACE_ASSERT (*t == c);
- // We need to guard against cached connections, which
- // will send multiple sequences of letters from 'a' ->
- // 'z' through the same connection.
- if (*t == 'z')
- t = ACE_ALPHABET;
- else
- t++;
- }
+ // We need to guard against cached connections, which
+ // will send multiple sequences of letters from 'a' ->
+ // 'z' through the same connection.
+ if (*t == 'z')
+ t = ACE_ALPHABET;
+ else
+ t++;
+ }
- if (r_bytes == 0)
+ if (r_bytes == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ASYS_TEXT ("(%P|%t) reached end of input, connection cached by client\n")));
+ else if (r_bytes == -1)
+ {
+ if (errno == EWOULDBLOCK)
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("(%P|%t) reached end of input, connection cached by client\n")));
- else if (r_bytes == -1)
- {
- if (errno == EWOULDBLOCK)
- ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("(%P|%t) no input available, going back to reading\n")));
- else
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%P|%t) %p\n"),
- ASYS_TEXT ("recv_n")),
- -1);
- }
-
- return 0;
+ ASYS_TEXT ("(%P|%t) no input available, going back to reading\n")));
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("(%P|%t) %p\n"),
+ ASYS_TEXT ("recv_n")),
+ -1);
}
+ return 0;
+}
- void
- test_connection_management (void)
- {
- NULL_CREATION_STRATEGY creation_strategy;
- NULL_ACTIVATION_STRATEGY activation_strategy;
+
+static void
+test_connection_management (CACHING_STRATEGY &caching_strategy)
+{
+ NULL_CREATION_STRATEGY creation_strategy;
+ NULL_ACTIVATION_STRATEGY activation_strategy;
- // Configure the Strategy Connector with a strategy that caches
- // connection.
- CACHING_STRATEGY caching_strategy;
- CACHED_CONNECT_STRATEGY caching_connect_strategy (caching_strategy);
+ // Configure the Strategy Connector with a strategy that caches
+ // connection.
+ CACHED_CONNECT_STRATEGY caching_connect_strategy (caching_strategy);
- STRATEGY_CONNECTOR strategy_connector (0,
- &creation_strategy,
- &caching_connect_strategy,
- &activation_strategy);
+ STRATEGY_CONNECTOR strategy_connector (0,
+ &creation_strategy,
+ &caching_connect_strategy,
+ &activation_strategy);
- // Set the purging percentage explicitly. By default it is 10%.
- // Note: The purge_percent could have been set before itself but,
- // the following has been done just to show how one would explicitly
- // set the purge_percent at any moment.
- CACHED_CONNECT_STRATEGY *connect_strategy =
- ACE_dynamic_cast (CACHED_CONNECT_STRATEGY *,
- strategy_connector.connect_strategy ());
+ // Set the purging percentage explicitly. By default it is 10%.
+ // Note: The purge_percent could have been set before itself but,
+ // the following has been done just to show how one would explicitly
+ // set the purge_percent at any moment.
+ CACHED_CONNECT_STRATEGY *connect_strategy =
+ ACE_dynamic_cast (CACHED_CONNECT_STRATEGY *,
+ strategy_connector.connect_strategy ());
- connect_strategy->caching_strategy ().purge_percent (purge_percentage);
+ connect_strategy->caching_strategy ().purge_percent (purge_percentage);
- for (int i = 0; i < n_servers; ++i)
- {
- // Acceptor
- ACCEPTOR acceptor;
- ACE_INET_Addr server_addr;
-
- // Bind acceptor to any port and then find out what the port
- // was.
- if (acceptor.open (ACE_sap_any_cast (const ACE_INET_Addr &)) == -1
- || acceptor.acceptor ().get_local_addr (server_addr) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- ASYS_TEXT ("(%P|%t) %p\n"),
- ASYS_TEXT ("open")));
- return;
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("(%P|%t) starting server at port %d\n"),
- server_addr.get_port_number ()));
- }
+ for (int i = 0; i < n_servers; ++i)
+ {
+ // Acceptor
+ ACCEPTOR acceptor;
+ ACE_INET_Addr server_addr;
- // Run the cached blocking test.
+ // Bind acceptor to any port and then find out what the port
+ // was.
+ if (acceptor.open (ACE_sap_any_cast (const ACE_INET_Addr &)) == -1
+ || acceptor.acceptor ().get_local_addr (server_addr) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ASYS_TEXT ("(%P|%t) %p\n"),
+ ASYS_TEXT ("open")));
+ return;
+ }
+ else
+ {
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("(%P|%t) *starting cached blocking connect\n")));
+ ASYS_TEXT ("(%P|%t) starting server at port %d\n"),
+ server_addr.get_port_number ()));
+ }
+
+ // Run the cached blocking test.
+ ACE_DEBUG ((LM_DEBUG,
+ ASYS_TEXT ("(%P|%t) *starting cached blocking connect\n")));
- int result = this->cached_connect (strategy_connector,
- server_addr);
- ACE_ASSERT (result != -1);
+ int result = cached_connect (strategy_connector,
+ server_addr);
+ ACE_ASSERT (result != -1);
- result = this->server (&acceptor);
- if (result == 1)
- {
- // Close connections which are cached by explicitly purging
- // the connection cache maintained by the connector.
- ACE_DEBUG ((LM_DEBUG, "Purging connections from Connection Cache...\n"));
+ result = server (&acceptor);
+ if (result == 1)
+ {
+ // Close connections which are cached by explicitly purging
+ // the connection cache maintained by the connector.
+ ACE_DEBUG ((LM_DEBUG, "Purging connections from Connection Cache...\n"));
- int retval = connect_strategy->purge_connections (purge_percentage);
- ACE_ASSERT (retval != -1);
- }
+ int retval = connect_strategy->purge_connections (purge_percentage);
+ ACE_ASSERT (retval != -1);
+ }
- ACE_ASSERT (result != -1);
- }
- }
+ ACE_ASSERT (result != -1);
+ }
+}
-};
+
int
parse_args (int argc, char *argv[])
@@ -297,7 +302,7 @@ parse_args (int argc, char *argv[])
"usage: %s "
"[-s (number of servers to connect to)] "
"[-p (purge percent)] "
- "[-c (caching_strategy_type 0=NULL , 1=LFU, 2=FIFO default=LRU)]\n",
+ "[-c (caching_strategy_type 0=NULL , 1=LRU, 2=LFU, 3=FIFO default=LRU)]\n",
argv[0]));
return -1;
}
@@ -318,33 +323,37 @@ main (int argc,
int result = parse_args (argc, argv);
ACE_ASSERT (result == 0);
+ CACHING_STRATEGY *caching_strategy = 0;
switch (caching_strategy_type)
{
case 0:
{
- Connection_Management<NULL_CACHING_STRATEGY> con_mgmt;
- con_mgmt.test_connection_management ();
+ caching_strategy = new NULL_CACHING_STRATEGY_ADAPTER;
+ test_connection_management (*caching_strategy);
break;
}
- case 1:
+ case 2:
{
- Connection_Management<LFU_CACHING_STRATEGY> con_mgmt;
- con_mgmt.test_connection_management ();
+ caching_strategy = new LFU_CACHING_STRATEGY_ADAPTER;
+ test_connection_management (*caching_strategy);
break;
}
- case 2:
+ case 3:
{
- Connection_Management<FIFO_CACHING_STRATEGY> con_mgmt;
- con_mgmt.test_connection_management ();
+ caching_strategy = new FIFO_CACHING_STRATEGY_ADAPTER;
+ test_connection_management (*caching_strategy);
break;
}
+ case 1:
default:
{
- Connection_Management<LRU_CACHING_STRATEGY> con_mgmt;
- con_mgmt.test_connection_management ();
+ caching_strategy = new LRU_CACHING_STRATEGY_ADAPTER;
+ test_connection_management (*caching_strategy);
+ break;
}
}
+ delete caching_strategy;
ACE_LOG_MSG->set_flags (ACE_Log_Msg::VERBOSE_LITE);
ACE_END_TEST;
return 0;
@@ -401,51 +410,30 @@ template class ACE_Hash_Map_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_
template class ACE_Hash_Map_Reverse_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>;
template class ACE_Hash_Map_Iterator_Base_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>;
-// = LRU_Caching_Strategy
-template class ACE_Hash_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, H_KEY, C_KEYS, LRU_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP, HASH_MAP::iterator, HASH_MAP::reverse_iterator, LRU_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::iterator, LRU_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::reverse_iterator, LRU_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, LRU_CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>;
-template class ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>;
-template class Connection_Management<LRU_CACHING_STRATEGY>;
-
-// = LFU_Caching_Strategy
-template class ACE_Hash_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, H_KEY, C_KEYS, LFU_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP, HASH_MAP::iterator, HASH_MAP::reverse_iterator, LFU_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::iterator, LFU_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::reverse_iterator, LFU_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, LFU_CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>;
-template class ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>;
-template class Connection_Management<LFU_CACHING_STRATEGY>;
-
-// = FIFO_Caching_Strategy
-template class ACE_Hash_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, H_KEY, C_KEYS, FIFO_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP, HASH_MAP::iterator, HASH_MAP::reverse_iterator, FIFO_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::iterator, FIFO_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::reverse_iterator, FIFO_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, FIFO_CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>;
+// = Caching_Strategy
+template class ACE_Hash_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES>;
+template class ACE_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP, HASH_MAP::iterator, HASH_MAP::reverse_iterator, CACHING_STRATEGY, ATTRIBUTES>;
+template class ACE_Cache_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::iterator, CACHING_STRATEGY, ATTRIBUTES>;
+template class ACE_Cache_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::reverse_iterator, CACHING_STRATEGY, ATTRIBUTES>;
+template class ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>;
template class ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>;
-template class Connection_Management<FIFO_CACHING_STRATEGY>;
-
-// = NULL_CACHING_STRATEGY
-template class ACE_Hash_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, H_KEY, C_KEYS, NULL_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP, HASH_MAP::iterator, HASH_MAP::reverse_iterator, NULL_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::iterator, NULL_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cache_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::reverse_iterator, NULL_CACHING_STRATEGY, ATTRIBUTES>;
-template class ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, NULL_CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>;
-template class ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>;
-template class Connection_Management<NULL_CACHING_STRATEGY>;
template class ACE_Cleanup_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP>;
template class ACE_Default_Cleanup_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP>;
template class ACE_Pair_Caching_Utility<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP::iterator, ATTRIBUTES>;
template class ACE_Svc_Cleanup_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP>;
+
+template class ACE_Caching_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>;
template class ACE_LRU_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>;
template class ACE_LFU_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>;
template class ACE_FIFO_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>;
template class ACE_Null_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>;
+template class ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY >;
+template class ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY >;
+template class ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY >;
+template class ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY >;
+
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
@@ -497,53 +485,30 @@ template class ACE_Null_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHE
#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>
#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>
-// = LRU_Caching_Strategy
-#pragma instantiate ACE_Hash_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, H_KEY, C_KEYS, LRU_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP, HASH_MAP::iterator, HASH_MAP::reverse_iterator, LRU_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::iterator, LRU_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::reverse_iterator, LRU_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, LRU_CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>
-#pragma instantiate ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>
-#pragma instantiate Connection_Management<LRU_CACHING_STRATEGY>
-
-// = LFU_Caching_Strategy
-#pragma instantiate ACE_Hash_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, H_KEY, C_KEYS, LFU_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP, HASH_MAP::iterator, HASH_MAP::reverse_iterator, LFU_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::iterator, LFU_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::reverse_iterator, LFU_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, LFU_CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>
+// = Caching_Strategy
+#pragma instantiate ACE_Hash_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES>
+#pragma instantiate ACE_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP, HASH_MAP::iterator, HASH_MAP::reverse_iterator, CACHING_STRATEGY, ATTRIBUTES>
+#pragma instantiate ACE_Cache_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::iterator, CACHING_STRATEGY, ATTRIBUTES>
+#pragma instantiate ACE_Cache_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::reverse_iterator, CACHING_STRATEGY, ATTRIBUTES>
+#pragma instantiate ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>
#pragma instantiate ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>
-#pragma instantiate Connection_Management<LFU_CACHING_STRATEGY>
-
-// = FIFO_Caching_Strategy
-#pragma instantiate ACE_Hash_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, H_KEY, C_KEYS, FIFO_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP, HASH_MAP::iterator, HASH_MAP::reverse_iterator, FIFO_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::iterator, FIFO_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::reverse_iterator, FIFO_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, FIFO_CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>
-#pragma instantiate ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>
-#pragma instantiate Connection_Management<FIFO_CACHING_STRATEGY>
-
-// = Null_Caching_Strategy
-#pragma instantiate ACE_Hash_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, H_KEY, C_KEYS, NULL_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP, HASH_MAP::iterator, HASH_MAP::reverse_iterator, NULL_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::iterator, NULL_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cache_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, HASH_MAP::reverse_iterator, NULL_CACHING_STRATEGY, ATTRIBUTES>
-#pragma instantiate ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, NULL_CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>
-#pragma instantiate ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>
-#pragma instantiate Connection_Management<NULL_CACHING_STRATEGY>
#pragma instantiate ACE_Cleanup_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP>
#pragma instantiate ACE_Default_Cleanup_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP>
#pragma instantiate ACE_Pair_Caching_Utility<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP::iterator, ATTRIBUTES>
#pragma instantiate ACE_Svc_Cleanup_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP>
+
+#pragma instantiate ACE_Caching_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
#pragma instantiate ACE_LRU_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
#pragma instantiate ACE_LFU_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
#pragma instantiate ACE_FIFO_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
#pragma instantiate ACE_Null_Caching_Strategy <REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY>
+#pragma instantiate ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY >
+#pragma instantiate ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY >
+#pragma instantiate ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY >
+#pragma instantiate ACE_Caching_Strategy_Adapter<REFCOUNTED_HASH_RECYCLABLE_ADDR, CACHED_HANDLER, HASH_MAP, ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY >
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
-
#endif /* CACHED_CONNECT_TEST */