3 //=============================================================================
5 * @file NT_Notify_Service.h
7 * Run the TAO Notify Service as a Windows NT Service.
9 * @author John Tucker <jtucker@infoglide.com>
10 * @author Mike Vitalo <mvitalo@infoglide.com>
11 * @author David Robison <drrobison@openroadsconsulting.com>
13 //=============================================================================
16 #ifndef TAO_NT_NOTIFY_SERVICE_H
17 #define TAO_NT_NOTIFY_SERVICE_H
19 #include /**/ "ace/NT_Service.h"
21 #if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_SERVICES)
23 #include /**/ "ace/Singleton.h"
24 #include /**/ "ace/Synch.h"
25 #include /**/ "tao/orbconf.h"
28 * @class TAO_NT_Notify_Service
30 * @brief Run the TAO Notify Service as a Windows NT Service.
32 class TAO_NT_Notify_Service
: public ACE_NT_Service
35 typedef TAO_SYNCH_RECURSIVE_MUTEX MUTEX
;
37 TAO_NT_Notify_Service (void);
38 virtual ~TAO_NT_Notify_Service (void);
40 /// We override <handle_control> because it handles stop requests
42 virtual void handle_control (DWORD control_code
);
44 /// We override <handle_exception> so a 'stop' control code can pop
45 /// the reactor off of its wait.
46 virtual int handle_exception (ACE_HANDLE h
);
48 /// This is a virtual method inherited from ACE_NT_Service.
49 virtual int svc (void);
51 /// Initialize the objects argc_ and argv_ attributes values.
52 virtual int init (int argc
,
55 /// Helper function for setting or reporting command line args
56 int set_args (const ACE_TCHAR
*args
);
59 void arg_manip (char *args
, DWORD arglen
, bool query
);
60 void report_error (const ACE_TCHAR
*format
,
64 // = Keep track of the "command-line" arguments.
71 ACE_TCHAR
**argv_save_
;
73 friend class ACE_Singleton
<TAO_NT_Notify_Service
, MUTEX
>;
76 typedef ACE_Singleton
<TAO_NT_Notify_Service
, TAO_NT_Notify_Service::MUTEX
> SERVICE
;
78 #endif /* ACE_WIN32 && !ACE_LACKS_WIN32_SERVICES */
79 #endif /* TAO_NT_NOTIFY_SERVER_H */