From 41d8656784be88e065136b8e0d52bd404bc52431 Mon Sep 17 00:00:00 2001 From: dhinton Date: Mon, 27 May 2002 18:53:59 +0000 Subject: ChangeLogTag:Mon May 27 18:48:42 UTC 2002 Don Hinton --- ChangeLog | 6 +++++ ChangeLogs/ChangeLog-02a | 6 +++++ ChangeLogs/ChangeLog-03a | 6 +++++ ace/Service_Config.cpp | 6 ++--- ace/Service_Config.h | 2 +- tests/Framework_Component_Test.cpp | 51 ++++++++++++++++++++++++++++---------- 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 + + * tests/Framework_Component_Test.cpp: + + Added new XML based config directives. + Mon May 27 13:18:51 UTC 2002 Don Hinton * 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 + + * tests/Framework_Component_Test.cpp: + + Added new XML based config directives. + Mon May 27 13:18:51 UTC 2002 Don Hinton * 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 + + * tests/Framework_Component_Test.cpp: + + Added new XML based config directives. + Mon May 27 13:18:51 UTC 2002 Don Hinton * 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 ( \ + " ") + +# define REMOVE_SERVICE(X) ACE_TEXT ( \ + " ") + +#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; } -- cgit v1.2.1