1 #include "ace/Service_Config.h"
2 #include "orbsvcs/Notify_Service/Notify_Service.h"
3 #include "orbsvcs/CosNotifyChannelAdminC.h"
4 #include "orbsvcs/CosNamingC.h"
8 char const * const scpc_orbId
= "testDllOrb";
10 ACE_TCHAR
const * const scpc_loadOrb
= ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
15 "testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1"
18 ACE_TCHAR
const * const scpc_unloadOrb
= ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
20 ACE_TCHAR
const * const scpc_loadNotifyService
= ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
24 "_make_TAO_Notify_Service_Driver",
25 "-NoNameSvc -RunThreads 0"
28 ACE_TCHAR
const * const scpc_unloadNotifyService
= ACE_REMOVE_SERVICE_DIRECTIVE("testNotifyService");
30 void loadunloadcycle()
34 ACE_TEXT ("(%P|%t) loadunloadcycle - loading\n")
37 int result
= ACE_Service_Config::process_directive(scpc_loadOrb
);
40 ACE_TEXT ("(%P|%t) loadunloadcycle - loading ORB done. Result: <%d>\n"),
45 ACE_Dynamic_Service
<DllORB
>::instance("testDllOrb");
47 CORBA::ORB_var v_orb
= p_orb
->orb();
50 ACE_TEXT ("(%P|%t) loadunloadcycle - v_orb OK\n")
53 CORBA::Object_var v_poa
=
54 v_orb
->resolve_initial_references("RootPOA");
57 ACE_TEXT ("(%P|%t) loadunloadcycle - v_poa OK\n")
60 PortableServer::POA_var v_rootPOA
=
61 PortableServer::POA::_narrow(v_poa
.in ());
64 ACE_TEXT ("(%P|%t) loadunloadcycle - v_rootPOA OK\n")
67 result
= ACE_Service_Config::process_directive(scpc_loadNotifyService
);
70 ACE_TEXT ("(%P|%t) loadunloadcycle - loading NotifyService done. Result: <%d>\n"),
74 TAO_Notify_Service_Driver
* p_notifyService
=
75 ACE_Dynamic_Service
<TAO_Notify_Service_Driver
>::instance("testNotifyService");
77 ACE_UNUSED_ARG (p_notifyService
);
81 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading\n")
86 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NotifyService ...\n")
88 result
= ACE_Service_Config::process_directive(scpc_unloadNotifyService
);
91 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NotifyService done. Result: <%d>\n"),
97 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB ...\n")
99 result
= ACE_Service_Config::process_directive(scpc_unloadOrb
);
102 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB done. Result: <%d>\n"),
107 int ACE_TMAIN (int , ACE_TCHAR
**)
111 ACE_TEXT ("(%P|%t) main - entered\n")
114 for (int cnt
= 0, max
= 2; cnt
< max
; ++cnt
)
118 ACE_TEXT ("(%P|%t) main - cycle %d ...\n"), cnt
123 ACE_TEXT ("(%P|%t) main - cycle %d done\n"), cnt
129 ACE_TEXT ("(%P|%t) main - leaving\n")