2 //=============================================================================
4 * @file Locator_NT_Service.h
6 * @author Darrell Brunsch <brunsch@cs.wustl.edu>
7 * @author Jeff Parsons <parsons@cs.wustl.edu>
8 * @author John Tucker <jtucker@infoglide.com>
9 * @author Mike Vitalo <mvitalo@infoglide.com>
11 //=============================================================================
13 #ifndef Locator_NT_Service_H
14 #define Locator_NT_Service_H
16 #include "ace/config-all.h"
18 #if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_SERVICES)
20 #include "ace/NT_Service.h"
21 #include "ace/Singleton.h"
22 #include "ace/Synch.h"
23 #include "tao/orbconf.h"
25 extern const ACE_TCHAR
* IMR_LOCATOR_SERVICE_NAME
;
26 extern const ACE_TCHAR
* IMR_LOCATOR_DISPLAY_NAME
;
27 extern const ACE_TCHAR
* IMR_LOCATOR_DESCRIPTION
;
30 * @class Locator_NT_Service
32 * @brief Allows the Implementation Repository to act as a Windows NT Service.
34 class Locator_NT_Service
: public ACE_NT_Service
37 typedef TAO_SYNCH_RECURSIVE_MUTEX MUTEX
;
39 /// We override <handle_control> because it handles stop requests
41 virtual void handle_control (DWORD control_code
);
43 /// We override <handle_exception> so a 'stop' control code can wake
44 /// the reactor off of its wait.
45 virtual int handle_exception (ACE_HANDLE h
);
47 /// This is a virtual method inherited from ACE_NT_Service.
48 virtual int svc (void);
51 friend class ACE_Singleton
<Locator_NT_Service
, MUTEX
>;
54 typedef ACE_Singleton
<Locator_NT_Service
, ACE_Mutex
> SERVICE
;
56 #endif /* ACE_WIN32 && !ACE_LACKS_WIN32_SERVICES */
58 #endif /* Locator_NT_Service_H */