Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Bug_3646b_Regression / server.cpp
blob2a8c410c42c6771a589890497d43c9fb3bc34be8
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 char const * const scpc_orbId = "testDllOrb";
10 ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
11 "testDllOrb",
12 "bug3646b",
13 TAO_VERSION,
14 "_make_DllORB",
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(
21 "testNotifyService",
22 "TAO_Notify_Service",
23 TAO_VERSION,
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()
32 ACE_DEBUG((
33 LM_DEBUG,
34 ACE_TEXT ("(%P|%t) loadunloadcycle - loading\n")
35 ));
37 int result = ACE_Service_Config::process_directive(scpc_loadOrb);
38 ACE_DEBUG((
39 LM_DEBUG,
40 ACE_TEXT ("(%P|%t) loadunloadcycle - loading ORB done. Result: <%d>\n"),
41 result
42 ));
44 DllORB * p_orb =
45 ACE_Dynamic_Service<DllORB>::instance("testDllOrb");
47 CORBA::ORB_var v_orb = p_orb->orb();
48 ACE_DEBUG((
49 LM_DEBUG,
50 ACE_TEXT ("(%P|%t) loadunloadcycle - v_orb OK\n")
51 ));
53 CORBA::Object_var v_poa =
54 v_orb->resolve_initial_references("RootPOA");
55 ACE_DEBUG((
56 LM_DEBUG,
57 ACE_TEXT ("(%P|%t) loadunloadcycle - v_poa OK\n")
58 ));
60 PortableServer::POA_var v_rootPOA =
61 PortableServer::POA::_narrow(v_poa.in ());
62 ACE_DEBUG((
63 LM_DEBUG,
64 ACE_TEXT ("(%P|%t) loadunloadcycle - v_rootPOA OK\n")
65 ));
67 result = ACE_Service_Config::process_directive(scpc_loadNotifyService);
68 ACE_DEBUG((
69 LM_DEBUG,
70 ACE_TEXT ("(%P|%t) loadunloadcycle - loading NotifyService done. Result: <%d>\n"),
71 result
72 ));
74 TAO_Notify_Service_Driver * p_notifyService =
75 ACE_Dynamic_Service<TAO_Notify_Service_Driver>::instance("testNotifyService");
77 ACE_UNUSED_ARG (p_notifyService);
79 ACE_DEBUG((
80 LM_DEBUG,
81 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading\n")
82 ));
84 ACE_DEBUG((
85 LM_DEBUG,
86 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NotifyService ...\n")
87 ));
88 result = ACE_Service_Config::process_directive(scpc_unloadNotifyService);
89 ACE_DEBUG((
90 LM_DEBUG,
91 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NotifyService done. Result: <%d>\n"),
92 result
93 ));
95 ACE_DEBUG((
96 LM_DEBUG,
97 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB ...\n")
98 ));
99 result = ACE_Service_Config::process_directive(scpc_unloadOrb);
100 ACE_DEBUG((
101 LM_DEBUG,
102 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB done. Result: <%d>\n"),
103 result
107 int ACE_TMAIN (int , ACE_TCHAR **)
109 ACE_DEBUG((
110 LM_DEBUG,
111 ACE_TEXT ("(%P|%t) main - entered\n")
114 for (int cnt = 0, max = 2; cnt < max; ++cnt)
116 ACE_DEBUG((
117 LM_DEBUG,
118 ACE_TEXT ("(%P|%t) main - cycle %d ...\n"), cnt
120 loadunloadcycle();
121 ACE_DEBUG((
122 LM_DEBUG,
123 ACE_TEXT ("(%P|%t) main - cycle %d done\n"), cnt
127 ACE_DEBUG((
128 LM_DEBUG,
129 ACE_TEXT ("(%P|%t) main - leaving\n")
132 return 0;