Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / FT_Naming_Service / FT_Naming_Main.cpp
blob1fc693a4ea8da4a6d06408e4706d640ab0544223
1 #include "orbsvcs/Log_Macros.h"
2 #include "FT_Naming_Service.h"
3 #include "ace/OS_main.h"
5 #include "orbsvcs/Shutdown_Utilities.h"
6 #include "tao/debug.h"
8 #include "tao/ImR_Client/ImR_Client.h"
10 class Naming_Svc_Shutdown : public Shutdown_Functor
12 public:
13 Naming_Svc_Shutdown (TAO_FT_Naming_Service& ns);
15 void operator() (int which_signal);
16 private:
17 TAO_FT_Naming_Service& ns_;
20 Naming_Svc_Shutdown::Naming_Svc_Shutdown (TAO_FT_Naming_Service& ns)
21 : ns_(ns)
25 void
26 Naming_Svc_Shutdown::operator() (int which_signal)
28 if (TAO_debug_level > 0)
29 ORBSVCS_DEBUG ((LM_DEBUG,
30 ACE_TEXT ("FT Name Service: shutting down on signal %d\n"),
31 which_signal));
32 (void) this->ns_.shutdown ();
35 // Driver function for the TAO FT Naming Service.
37 int
38 ACE_TMAIN (int argc, ACE_TCHAR *argv[])
40 TAO_FT_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")),
49 1);
50 try
52 naming_service.run ();
54 catch (const CORBA::Exception& ex)
56 ex._tao_print_exception (ACE_TEXT ("NamingService"));
57 return 1;
60 naming_service.fini ();
62 return 0;