Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Bug_3646b_Regression / server.cpp
bloba38b5fc0ee2c367f1a6b2c8c186eed7fc349ea5d
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 "bug3646b",
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",
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 for (int cnt = 0, max = 2; cnt < max; ++cnt)
114 ACE_DEBUG((
115 LM_DEBUG,
116 ACE_TEXT ("(%P|%t) main - cycle %d ...\n"), cnt
118 loadunloadcycle();
119 ACE_DEBUG((
120 LM_DEBUG,
121 ACE_TEXT ("(%P|%t) main - cycle %d done\n"), cnt
125 ACE_DEBUG((
126 LM_DEBUG,
127 ACE_TEXT ("(%P|%t) main - leaving\n")
130 return 0;