summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordhinton <dhinton@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-05-27 18:53:59 +0000
committerdhinton <dhinton@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-05-27 18:53:59 +0000
commit41d8656784be88e065136b8e0d52bd404bc52431 (patch)
treec350d374bb7fa246465a230364a1da86e36c34b8
parente88164ac755420b6025c3182ab48718058a8825d (diff)
downloadATCD-dll_singleton.tar.gz
ChangeLogTag:Mon May 27 18:48:42 UTC 2002 Don Hinton <dhinton@ieee.org>dll_singleton
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLogs/ChangeLog-02a6
-rw-r--r--ChangeLogs/ChangeLog-03a6
-rw-r--r--ace/Service_Config.cpp6
-rw-r--r--ace/Service_Config.h2
-rw-r--r--tests/Framework_Component_Test.cpp51
6 files changed, 60 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 1bdcd8c59ba..edfc8f4b764 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon May 27 18:48:42 UTC 2002 Don Hinton <dhinton@ieee.org>
+
+ * tests/Framework_Component_Test.cpp:
+
+ Added new XML based config directives.
+
Mon May 27 13:18:51 UTC 2002 Don Hinton <dhinton@ieee.org>
* ace/OS.i (mkstemp):
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 1bdcd8c59ba..edfc8f4b764 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,9 @@
+Mon May 27 18:48:42 UTC 2002 Don Hinton <dhinton@ieee.org>
+
+ * tests/Framework_Component_Test.cpp:
+
+ Added new XML based config directives.
+
Mon May 27 13:18:51 UTC 2002 Don Hinton <dhinton@ieee.org>
* ace/OS.i (mkstemp):
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 1bdcd8c59ba..edfc8f4b764 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,9 @@
+Mon May 27 18:48:42 UTC 2002 Don Hinton <dhinton@ieee.org>
+
+ * tests/Framework_Component_Test.cpp:
+
+ Added new XML based config directives.
+
Mon May 27 13:18:51 UTC 2002 Don Hinton <dhinton@ieee.org>
* ace/OS.i (mkstemp):
diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp
index 34ca86bc6c9..0da87d83656 100644
--- a/ace/Service_Config.cpp
+++ b/ace/Service_Config.cpp
@@ -228,12 +228,12 @@ ACE_Service_Config::parse_args (int argc, ACE_TCHAR *argv[])
ACE_Service_Type *
ACE_Service_Config::create_service_type (const ACE_TCHAR *n,
ACE_Service_Type_Impl *o,
- const ACE_SHLIB_HANDLE handle,
+ ACE_DLL &dll,
int active)
{
ACE_Service_Type *sp = 0;
ACE_NEW_RETURN (sp,
- ACE_Service_Type (n, o, handle, active),
+ ACE_Service_Type (n, o, dll, active),
0);
return sp;
}
@@ -389,7 +389,7 @@ ACE_Service_Config::get_xml_svc_conf (ACE_DLL &xmldll)
0);
void *foo;
- foo = xmldll.symbol (ACE_LIB_TEXT ("_ACEXML_create_XML_Svc_Conf_Object");
+ foo = xmldll.symbol (ACE_LIB_TEXT ("_ACEXML_create_XML_Svc_Conf_Object"));
// Cast the void* to long first.
long tmp = ACE_reinterpret_cast (long, foo);
diff --git a/ace/Service_Config.h b/ace/Service_Config.h
index de136e1feda..a72975ea3ed 100644
--- a/ace/Service_Config.h
+++ b/ace/Service_Config.h
@@ -356,7 +356,7 @@ public:
#if (ACE_USES_CLASSIC_SVC_CONF == 0)
static ACE_Service_Type *create_service_type (const ACE_TCHAR *n,
ACE_Service_Type_Impl *o,
- const ACE_SHLIB_HANDLE handle,
+ ACE_DLL &dll,
int active);
#endif /* ACE_USES_CLASSIC_SVC_CONF == 0 */
diff --git a/tests/Framework_Component_Test.cpp b/tests/Framework_Component_Test.cpp
index f92935d8e18..2b7092a2256 100644
--- a/tests/Framework_Component_Test.cpp
+++ b/tests/Framework_Component_Test.cpp
@@ -25,6 +25,29 @@
ACE_RCSID(tests, Framework_Component_Test, "$Id$")
+// Define a few macros--because they're so much fun, and keep the
+// code below a little cleaner...
+#if (ACE_USES_CLASSIC_SVC_CONF == 1)
+
+# define ADD_SERVICE(X) ACE_TEXT ( \
+ "dynamic Server_" #X " Service_Object * " \
+ "Framework_Component_DLL:_make_Server_" #X "() ''")
+
+# define REMOVE_SERVICE(X) ACE_TEXT ( \
+ "remove Server_" #X)
+
+#else /* ACE_USES_CLASSIC_SVC_CONF */
+
+# define ADD_SERVICE(X) ACE_TEXT ( \
+ "<?xml version='1.0'?> <dynamic id='Server_" #X "' " \
+ "type='service_object'> <initializer init='_make_Server_" #X "' " \
+ "path='Framework_Component_DLL' params=''/> </dynamic>")
+
+# define REMOVE_SERVICE(X) ACE_TEXT ( \
+ "<?xml version='1.0'?> <remove id='Server_" #X "'> </remove>")
+
+#endif /* ACE_USES_CLASSIC_SVC_CONF */
+
int
run_test (u_long unload_mask = 0)
{
@@ -42,34 +65,36 @@ run_test (u_long unload_mask = 0)
args.add (ACE_TEXT ("Framework_Component_Test"));
args.add (ACE_TEXT ("-n"));
args.add (ACE_TEXT ("-d"));
- args.add (ACE_TEXT ("-S"));
- args.add (ACE_TEXT ("\"dynamic Server_1 Service_Object * "
- "Framework_Component_DLL:_make_Server_1() 'xxx' \""));
- // Load it, should load a dll.
+ // Initialize Service Config.
ACE_Service_Config::open (args.argc (), args.argv ());
- // And unload the first one, should *not* unload the dll.
- ACE_Service_Config::process_directive (ACE_TEXT ("remove Server_1"));
+ // Now add server 1.
+ ACE_Service_Config::process_directive (ADD_SERVICE(1));
+
+ // And unload the first one, could unload the dll.
+ ACE_Service_Config::process_directive (REMOVE_SERVICE(1));
+
+ // Now readd server 1.
+ ACE_Service_Config::process_directive (ADD_SERVICE(1));
- // Now load another service from the same library.
- ACE_Service_Config::process_directive
- (ACE_TEXT ("dynamic Server_2 Service_Object * "
- "Framework_Component_DLL:_make_Server_2() 'xxx' "));
+ // And load another service from the same library.
+ ACE_Service_Config::process_directive (ADD_SERVICE(2));
- // And unload the first one, should *not* unload the dll.
- //ACE_Service_Config::process_directive (ACE_TEXT ("remove Server_1"));
+ // Unload the first one again, should *not* unload the dll this time.
+ ACE_Service_Config::process_directive (REMOVE_SERVICE(1));
// And unload the second service. Since the ACE_DLL_Handle will no longer
// have any references, the ACE_DLL_Manager will apply it's current unloading
// strategy and either call ACE_OS::dlclose() immediately, schedule a timeout
// the the reactor to call dlclose() some time in the future, or keep the
// dll loaded until program termination.
- ACE_Service_Config::process_directive (ACE_TEXT ("remove Server_2"));
+ ACE_Service_Config::process_directive (REMOVE_SERVICE(2));
// Force unloading so we'll be ready for the next test.
ACE_DLL_Manager::instance ()->unload_strategy (ACE_DLL_Manager_Ex::DEFAULT);
+ ACE_Service_Config::close ();
return 0;
}