#include <Activator_NT_Service.h>
Public Types | |
typedef TAO_SYNCH_RECURSIVE_MUTEX | MUTEX |
Public Member Functions | |
virtual void | handle_control (DWORD control_code) |
virtual int | handle_exception (ACE_HANDLE h) |
virtual int | svc (void) |
This is a virtual method inherited from ACE_NT_Service. | |
Friends | |
class | ACE_Singleton< Activator_NT_Service, MUTEX > |
Definition at line 40 of file Activator_NT_Service.h.
|
Definition at line 43 of file Activator_NT_Service.h. |
|
We override because it handles stop requests privately. Definition at line 30 of file Activator_NT_Service.cpp. References ACE_Reactor::end_reactor_event_loop(), TAO_ORB_Core::orb(), TAO_ORB_Core::reactor(), and TAO_ORB_Core_instance().
00031 { 00032 if (control_code == SERVICE_CONTROL_SHUTDOWN 00033 || control_code == SERVICE_CONTROL_STOP) 00034 { 00035 report_status (SERVICE_STOP_PENDING); 00036 TAO_ORB_Core_instance ()->reactor ()->end_reactor_event_loop (); 00037 TAO_ORB_Core_instance ()->orb ()->shutdown (1); 00038 } 00039 else 00040 { 00041 ACE_NT_Service::handle_control (control_code); 00042 } 00043 } |
|
We override so a 'stop' control code can wake the reactor off of its wait. Definition at line 49 of file Activator_NT_Service.cpp.
00050 {
00051 return 0;
00052 }
|
|
This is a virtual method inherited from ACE_NT_Service. We do almost the same thing as we do in run_standalone () except that we update the report_status after init. Definition at line 60 of file Activator_NT_Service.cpp. References ImR_Activator_i::fini(), ImR_Activator_i::init(), Activator_Options::init_from_registry(), and ImR_Activator_i::run().
00061 { 00062 ImR_Activator_i server; 00063 Activator_Options opts; 00064 00065 if (opts.init_from_registry() != 0) 00066 { 00067 report_status (SERVICE_STOPPED); 00068 return -1; 00069 } 00070 00071 try 00072 { 00073 int status = server.init (opts); 00074 00075 if (status == -1) 00076 { 00077 report_status (SERVICE_STOPPED); 00078 return -1; 00079 } 00080 else 00081 { 00082 report_status (SERVICE_RUNNING); 00083 server.run (); 00084 00085 status = server.fini (); 00086 00087 report_status (SERVICE_STOPPED); 00088 00089 } 00090 if (status != -1) 00091 return 0; 00092 } 00093 catch (const CORBA::SystemException& sysex) 00094 { 00095 sysex._tao_print_exception (IMR_ACTIVATOR_DISPLAY_NAME); 00096 } 00097 catch (const CORBA::UserException& userex) 00098 { 00099 userex._tao_print_exception (IMR_ACTIVATOR_DISPLAY_NAME); 00100 } 00101 catch (const CORBA::Exception& ex) 00102 { 00103 ex._tao_print_exception (IMR_ACTIVATOR_DISPLAY_NAME); 00104 } 00105 00106 report_status (SERVICE_STOPPED); 00107 return -1; 00108 } |
|
Definition at line 56 of file Activator_NT_Service.h. |