Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Bug_3646d_Regression / server.cpp
blobf7c129c362892a399bd3eb7dff7e267e8633592a
1 #include "ace/Service_Config.h"
2 #include "orbsvcs/Notify_Service/Notify_Service.h"
3 #include "orbsvcs/CosNotifyChannelAdminC.h"
4 #include "orbsvcs/CosNamingC.h"
6 #include "DllORB.h"
8 ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
9 "testDllOrb",
10 "bug3646d",
11 TAO_VERSION,
12 "_make_DllORB",
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(
19 "testNotifyService",
20 "TAO_Notify_Service",
21 TAO_VERSION,
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(
29 "testNamingService",
30 "TAO_CosNaming_Serv",
31 TAO_VERSION,
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()
40 ACE_DEBUG((
41 LM_DEBUG,
42 ACE_TEXT ("(%P|%t) loadunloadcycle - loading\n")
43 ));
45 int result = ACE_Service_Config::process_directive(scpc_loadOrb);
46 ACE_DEBUG((
47 LM_DEBUG,
48 ACE_TEXT ("(%P|%t) loadunloadcycle - loading ORB done. Result: <%d>\n"),
49 result
50 ));
52 DllORB * p_orb =
53 ACE_Dynamic_Service<DllORB>::instance("testDllOrb");
55 CORBA::ORB_var v_orb = p_orb->orb();
56 ACE_DEBUG((
57 LM_DEBUG,
58 ACE_TEXT ("(%P|%t) loadunloadcycle - v_orb OK\n")
59 ));
61 CORBA::Object_var v_poa =
62 v_orb->resolve_initial_references("RootPOA");
63 ACE_DEBUG((
64 LM_DEBUG,
65 ACE_TEXT ("(%P|%t) loadunloadcycle - v_poa OK\n")
66 ));
68 PortableServer::POA_var v_rootPOA =
69 PortableServer::POA::_narrow(v_poa.in ());
70 ACE_DEBUG((
71 LM_DEBUG,
72 ACE_TEXT ("(%P|%t) loadunloadcycle - v_rootPOA OK\n")
73 ));
75 result = ACE_Service_Config::process_directive(scpc_loadNameService);
76 ACE_DEBUG((
77 LM_DEBUG,
78 ACE_TEXT ("(%P|%t) loadunloadcycle - loading NamingService done. Result: <%d>\n"),
79 result
80 ));
82 result = ACE_Service_Config::process_directive(scpc_loadNotifyService);
83 ACE_DEBUG((
84 LM_DEBUG,
85 ACE_TEXT ("(%P|%t) loadunloadcycle - loading NotifyService done. Result: <%d>\n"),
86 result
87 ));
89 ACE_DEBUG((
90 LM_DEBUG,
91 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading\n")
92 ));
94 ACE_DEBUG((
95 LM_DEBUG,
96 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NotifyService ...\n")
97 ));
98 result = ACE_Service_Config::process_directive(scpc_unloadNotifyService);
99 ACE_DEBUG((
100 LM_DEBUG,
101 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NotifyService done. Result: <%d>\n"),
102 result
105 ACE_DEBUG((
106 LM_DEBUG,
107 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NameService ...\n")
109 result = ACE_Service_Config::process_directive(scpc_unloadNameService);
110 ACE_DEBUG((
111 LM_DEBUG,
112 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NameService done. Result: <%d>\n"),
113 result
116 ACE_DEBUG((
117 LM_DEBUG,
118 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB ...\n")
120 result = ACE_Service_Config::process_directive(scpc_unloadOrb);
121 ACE_DEBUG((
122 LM_DEBUG,
123 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB done. Result: <%d>\n"),
124 result
128 int ACE_TMAIN (int , ACE_TCHAR **)
130 ACE_DEBUG((
131 LM_DEBUG,
132 ACE_TEXT ("(%P|%t) main - entered\n")
135 for (int cnt = 0, max = 10; cnt < max; ++cnt)
137 ACE_DEBUG((
138 LM_DEBUG,
139 ACE_TEXT ("(%P|%t) main - cycle %d ...\n"), cnt
141 loadunloadcycle();
142 ACE_DEBUG((
143 LM_DEBUG,
144 ACE_TEXT ("(%P|%t) main - cycle %d done\n"), cnt
148 ACE_DEBUG((
149 LM_DEBUG,
150 ACE_TEXT ("(%P|%t) main - leaving\n")
153 return 0;