Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Bug_3663_Regression / server.cpp
blobdcb485c86add5f5efb5af5e4c093cfcf63f9a8f7
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 "bug3663",
11 TAO_VERSION,
12 "_make_DllORB",
13 "testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1"
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_INCORRECT",
23 "-NoNameSvc -RunThreads 0"
26 ACE_TCHAR const * const scpc_unloadNotifyService = ACE_REMOVE_SERVICE_DIRECTIVE("testNotifyService");
28 void loadunloadcycle()
30 ACE_DEBUG((
31 LM_DEBUG,
32 ACE_TEXT ("(%P|%t) loadunloadcycle - loading\n")
33 ));
35 int result = ACE_Service_Config::process_directive(scpc_loadOrb);
36 ACE_DEBUG((
37 LM_DEBUG,
38 ACE_TEXT ("(%P|%t) loadunloadcycle - loading ORB done. Result: <%d>\n"),
39 result
40 ));
42 DllORB * p_orb =
43 ACE_Dynamic_Service<DllORB>::instance("testDllOrb");
45 CORBA::ORB_var v_orb = p_orb->orb();
46 ACE_DEBUG((
47 LM_DEBUG,
48 ACE_TEXT ("(%P|%t) loadunloadcycle - v_orb OK\n")
49 ));
51 CORBA::Object_var v_poa =
52 v_orb->resolve_initial_references("RootPOA");
53 ACE_DEBUG((
54 LM_DEBUG,
55 ACE_TEXT ("(%P|%t) loadunloadcycle - v_poa OK\n")
56 ));
58 PortableServer::POA_var v_rootPOA =
59 PortableServer::POA::_narrow(v_poa.in ());
60 ACE_DEBUG((
61 LM_DEBUG,
62 ACE_TEXT ("(%P|%t) loadunloadcycle - v_rootPOA OK\n")
63 ));
65 result = ACE_Service_Config::process_directive(scpc_loadNotifyService);
66 ACE_DEBUG((
67 LM_DEBUG,
68 ACE_TEXT ("(%P|%t) loadunloadcycle - loading NotifyService done. Result: <%d>\n"),
69 result
70 ));
72 TAO_Notify_Service_Driver * p_notifyService =
73 ACE_Dynamic_Service<TAO_Notify_Service_Driver>::instance("testNotifyService");
75 ACE_UNUSED_ARG (p_notifyService);
77 ACE_DEBUG((
78 LM_DEBUG,
79 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading\n")
80 ));
82 ACE_DEBUG((
83 LM_DEBUG,
84 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NotifyService ...\n")
85 ));
86 result = ACE_Service_Config::process_directive(scpc_unloadNotifyService);
87 ACE_DEBUG((
88 LM_DEBUG,
89 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NotifyService done. Result: <%d>\n"),
90 result
91 ));
93 ACE_DEBUG((
94 LM_DEBUG,
95 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB ...\n")
96 ));
97 result = ACE_Service_Config::process_directive(scpc_unloadOrb);
98 ACE_DEBUG((
99 LM_DEBUG,
100 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB done. Result: <%d>\n"),
101 result
105 int ACE_TMAIN (int , ACE_TCHAR **)
107 ACE_DEBUG((
108 LM_DEBUG,
109 ACE_TEXT ("(%P|%t) main - entered\n")
112 ACE_DEBUG((
113 LM_DEBUG,
114 ACE_TEXT ("(%P|%t) main - cycle 1 ...\n")
116 loadunloadcycle();
117 ACE_DEBUG((
118 LM_DEBUG,
119 ACE_TEXT ("(%P|%t) main - cycle 1 done\n")
122 ACE_DEBUG((
123 LM_DEBUG,
124 ACE_TEXT ("(%P|%t) main - cycle 2 ...\n")
126 loadunloadcycle();
127 ACE_DEBUG((
128 LM_DEBUG,
129 ACE_TEXT ("(%P|%t) main - cycle 2 done\n")
132 ACE_DEBUG((
133 LM_DEBUG,
134 ACE_TEXT ("(%P|%t) main - leaving\n")
137 return 0;