1 #include "ace/Service_Config.h"
2 #include "orbsvcs/Naming/Naming_Loader.h"
6 char const * const scpc_orbId
= "testDllOrb";
8 ACE_TCHAR
const * const scpc_loadOrb
= ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
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_loadNamingService
= ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
22 "_make_TAO_Naming_Loader",
26 ACE_TCHAR
const * const scpc_unloadNamingService
= ACE_REMOVE_SERVICE_DIRECTIVE("testNamingService");
28 void loadunloadcycle()
32 ACE_TEXT ("(%P|%t) loadunloadcycle - loading\n")
35 int result
= ACE_Service_Config::process_directive(scpc_loadOrb
);
38 ACE_TEXT ("(%P|%t) loadunloadcycle - loading ORB done. Result: <%d>\n"),
43 ACE_Dynamic_Service
<DllORB
>::instance("testDllOrb");
49 ACE_TEXT ("(%P|%t) loadunloadcycle - v_orb OK\n")
52 CORBA::Object_var v_poa
=
53 v_orb
->resolve_initial_references("RootPOA");
56 ACE_TEXT ("(%P|%t) loadunloadcycle - v_poa OK\n")
59 PortableServer::POA_var v_rootPOA
=
60 PortableServer::POA::_narrow(v_poa
.in ());
63 ACE_TEXT ("(%P|%t) loadunloadcycle - v_rootPOA OK\n")
66 result
= ACE_Service_Config::process_directive(scpc_loadNamingService
);
69 ACE_TEXT ("(%P|%t) loadunloadcycle - loading NamingService done. Result: <%d>\n"),
73 TAO_Naming_Loader
* p_NamingService
=
74 ACE_Dynamic_Service
<TAO_Naming_Loader
>::instance("testNamingService");
76 ACE_UNUSED_ARG (p_NamingService
);
80 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading\n")
85 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NamingService ...\n")
87 result
= ACE_Service_Config::process_directive(scpc_unloadNamingService
);
90 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading NamingService done. Result: <%d>\n"),
96 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB ...\n")
98 result
= ACE_Service_Config::process_directive(scpc_unloadOrb
);
101 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB done. Result: <%d>\n"),
106 int ACE_TMAIN (int , ACE_TCHAR
**)
110 ACE_TEXT ("(%P|%t) main - entered\n")
115 ACE_TEXT ("(%P|%t) main - cycle 1 ...\n")
120 ACE_TEXT ("(%P|%t) main - cycle 1 done\n")
125 ACE_TEXT ("(%P|%t) main - cycle 2 ...\n")
130 ACE_TEXT ("(%P|%t) main - cycle 2 done\n")
135 ACE_TEXT ("(%P|%t) main - leaving\n")