Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_3499_Regression / DLL_TAO_Service.cpp
blobe6283b5bb5e7c52d44cb39d8ec36d437725c3352
1 #include "DLL_TAO_Service.h"
3 ACE_DLL_SERVICE_IMPL (ACE_DLL_TAO_Service, _make_ACE_DLL_TAO_Service)
5 ACE_DLL_TAO_Service::ACE_DLL_TAO_Service (void)
7 ACE_DLL_TAO_SERVICE_TRACE (ACE_TEXT ("ACE_DLL_TAO_Service::ACE_DLL_TAO_Service (void)"));
10 ACE_DLL_TAO_Service::~ACE_DLL_TAO_Service (void)
12 ACE_DLL_TAO_SERVICE_TRACE (ACE_TEXT ("ACE_DLL_TAO_Service::~ACE_DLL_TAO_Service (void)"));
15 int ACE_DLL_TAO_Service::init (int argc, ACE_TCHAR * argv [])
17 ACE_DLL_TAO_SERVICE_TRACE (ACE_TEXT ("ACE_DLL_TAO_Service::init (int, ACE_TCHAR * [])"));
19 try
21 ACE_DEBUG ((LM_DEBUG,
22 ACE_TEXT ("(%t) %T - %M - initializing the CORBA ORB\n")));
23 this->orb_ = CORBA::ORB_init (argc, argv);
25 // This call should fail unless '-ORBGestalt CURRENT' is passed as a command-line
26 // option during ORB_init (...).
27 ACE_DEBUG ((LM_DEBUG,
28 ACE_TEXT ("(%t) %T - %M - resolving the RootPOA\n")));
30 CORBA::Object_var obj =
31 this->orb_->resolve_initial_references ("RootPOA");
32 this->root_poa_ = PortableServer::POA::_narrow (obj.in ());
34 catch (const CORBA::Exception & ex)
36 ACE_ERROR ((LM_ERROR,
37 ACE_TEXT ("(%t) %T - %M - %s\n"),
38 ex._info ().c_str ()));
39 return -1;
42 return 0;
45 int ACE_DLL_TAO_Service::fini (void)
47 ACE_DLL_TAO_SERVICE_TRACE (ACE_TEXT ("ACE_DLL_TAO_Service::fini (void)"));
49 try
51 this->orb_->shutdown (1);
53 this->root_poa_->destroy (1, 1);
54 this->orb_->destroy ();
56 catch (const CORBA::Exception & ex)
58 ACE_ERROR ((LM_ERROR,
59 ACE_TEXT ("(%t) %T - %M - %s\n"),
60 ex._info ().c_str ()));
61 return -1;
64 return 0;