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 ACE_TCHAR
const * const scpc_loadOrb
= ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
13 "testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1 -ORBInitRef NameService=file://naming.ior"
16 ACE_TCHAR
const * const scpc_unloadOrb
= ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
18 ACE_TCHAR
const * const scpc_loadNotifyService
= ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
22 "_make_TAO_Notify_Service_Driver",
23 "-Channel -ChannelName Channel1 -ChannelName Channel2 -RunThreads 10 -ORBInitRef NameService=file://naming.ior -IORoutput notify.ior"
26 ACE_TCHAR
const * const scpc_unloadNotifyService
= ACE_REMOVE_SERVICE_DIRECTIVE("testNotifyService");
28 ACE_TCHAR
const * const scpc_loadNameService
= ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
32 "_make_TAO_Naming_Loader",
33 "testNameService testNameService -ORBId testDllOrb -m 0 -o naming.ior"
36 ACE_TCHAR
const * const scpc_unloadNameService
= ACE_REMOVE_SERVICE_DIRECTIVE("testNamingService");
38 void loadunloadcycle()
42 ACE_TEXT ("(%P|%t) loadunloadcycle - loading\n")
45 int result
= ACE_Service_Config::process_directive(scpc_loadOrb
);
48 ACE_TEXT ("(%P|%t) loadunloadcycle - loading ORB done. Result: <%d>\n"),
53 ACE_Dynamic_Service
<DllORB
>::instance("testDllOrb");
55 CORBA::ORB_var v_orb
= p_orb
->orb();
58 ACE_TEXT ("(%P|%t) loadunloadcycle - v_orb OK\n")
61 CORBA::Object_var v_poa
=
62 v_orb
->resolve_initial_references("RootPOA");
65 ACE_TEXT ("(%P|%t) loadunloadcycle - v_poa OK\n")
68 PortableServer::POA_var v_rootPOA
=
69 PortableServer::POA::_narrow(v_poa
.in ());
72 ACE_TEXT ("(%P|%t) loadunloadcycle - v_rootPOA OK\n")
75 result
= ACE_Service_Config::process_directive(scpc_loadNameService
);
78 ACE_TEXT ("(%P|%t) loadunloadcycle - loading NamingService done. Result: <%d>\n"),
82 result
= ACE_Service_Config::process_directive(scpc_loadNotifyService
);
85 ACE_TEXT ("(%P|%t) loadunloadcycle - loading NotifyService done. Result: <%d>\n"),
91 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading\n")
96 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NotifyService ...\n")
98 result
= ACE_Service_Config::process_directive(scpc_unloadNotifyService
);
101 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NotifyService done. Result: <%d>\n"),
107 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NameService ...\n")
109 result
= ACE_Service_Config::process_directive(scpc_unloadNameService
);
112 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NameService done. Result: <%d>\n"),
118 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB ...\n")
120 result
= ACE_Service_Config::process_directive(scpc_unloadOrb
);
123 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB done. Result: <%d>\n"),
128 int ACE_TMAIN (int , ACE_TCHAR
**)
132 ACE_TEXT ("(%P|%t) main - entered\n")
135 for (int cnt
= 0, max
= 10; cnt
< max
; ++cnt
)
139 ACE_TEXT ("(%P|%t) main - cycle %d ...\n"), cnt
144 ACE_TEXT ("(%P|%t) main - cycle %d done\n"), cnt
150 ACE_TEXT ("(%P|%t) main - leaving\n")