1 #include "orbsvcs/Log_Macros.h"
2 #include "Naming_Service.h"
3 #include "ace/OS_main.h"
5 #include "orbsvcs/Shutdown_Utilities.h"
8 #include "tao/ImR_Client/ImR_Client.h"
10 class Naming_Svc_Shutdown
: public Shutdown_Functor
13 Naming_Svc_Shutdown(TAO_Naming_Service
& ns
);
15 void operator() (int which_signal
);
17 TAO_Naming_Service
& ns_
;
20 Naming_Svc_Shutdown::Naming_Svc_Shutdown (TAO_Naming_Service
&ns
)
26 Naming_Svc_Shutdown::operator() (int which_signal
)
28 if (TAO_debug_level
> 0)
29 ORBSVCS_DEBUG ((LM_DEBUG
,
30 "Name Service: shutting down on signal %d\n",
32 (void) this->ns_
.shutdown ();
35 // Driver function for the TAO Naming Service.
38 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
40 TAO_Naming_Service naming_service
;
42 // Stuff to insure that we're gracefully shut down...
43 Naming_Svc_Shutdown
killer (naming_service
);
44 Service_Shutdown
kill_contractor(killer
);
46 if (naming_service
.init (argc
, argv
) == -1)
47 ORBSVCS_ERROR_RETURN ((LM_ERROR
,
48 ACE_TEXT("Failed to start the Naming Service.\n")),
53 naming_service
.run ();
55 catch (const CORBA::Exception
& ex
)
57 ex
._tao_print_exception ("NamingService");
61 naming_service
.fini ();