Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / orbsvcs / Notify_Service / NT_Notify_Service.h
blob6377ab63421934265fa9e8e1c32cb54c3f5575d2
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
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"
27 /**
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
34 public:
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
41 /// privately.
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,
53 ACE_TCHAR *argv[]);
55 /// Helper function for setting or reporting command line args
56 int set_args (const ACE_TCHAR *args);
58 private:
59 void arg_manip (char *args, DWORD arglen, bool query);
60 void report_error (const ACE_TCHAR *format,
61 const ACE_TCHAR *val,
62 LONG result);
64 // = Keep track of the "command-line" arguments.
65 /// Argument count.
66 int argc_;
67 int argc_save_;
69 /// Argument list.
70 ACE_TCHAR **argv_;
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 */