summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgonzo <gonzo@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-03-08 23:40:24 +0000
committergonzo <gonzo@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-03-08 23:40:24 +0000
commitddd182af6f4d8ba9f6b769eed40d1463efefba19 (patch)
tree62fb4dfbae8ae84f46cdb4830f51c53be237f08d
parentb2ca53ca3379d7668399003fe7c6603a9e8f8db2 (diff)
downloadATCD-ddd182af6f4d8ba9f6b769eed40d1463efefba19.tar.gz
ChangeLogTag: Mon Mar 8 17:35:04 1999 Gonzalo Diethelm <gonzo@tango.cs.wustl.edu>
-rw-r--r--ChangeLog-99b9
-rw-r--r--ace/NT_Service.cpp46
-rw-r--r--ace/NT_Service.h12
3 files changed, 58 insertions, 9 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b
index 7a94495f0d1..fa42a6eff93 100644
--- a/ChangeLog-99b
+++ b/ChangeLog-99b
@@ -1,3 +1,12 @@
+Mon Mar 8 17:35:04 1999 Gonzalo Diethelm <gonzo@tango.cs.wustl.edu>
+
+ * ace/NT_Service.cpp:
+ * ace/NT_Service.h:
+ Now the handle_control method calls separate protected virtual
+ methods to do its work. That way, it is easier to override what
+ must be done on each case, just by overriding one of the new
+ methods.
+
Mon Mar 08 15:41:08 1999 Steve Huston <shuston@riverace.com>
* include/makeinclude/platform_hpux.GNU: Added -DACE_LACKS_PRAGMA_ONCE.
diff --git a/ace/NT_Service.cpp b/ace/NT_Service.cpp
index 7290f9d6e68..7e2551b79d8 100644
--- a/ace/NT_Service.cpp
+++ b/ace/NT_Service.cpp
@@ -83,24 +83,19 @@ ACE_NT_Service::handle_control (DWORD control_code)
switch(control_code) {
case SERVICE_CONTROL_SHUTDOWN:
case SERVICE_CONTROL_STOP:
- report_status(SERVICE_STOP_PENDING);
- /* how to cancel? */
+ stop_requested(control_code);
break;
case SERVICE_CONTROL_PAUSE:
- report_status(SERVICE_PAUSE_PENDING);
- this->suspend();
- report_status(SERVICE_PAUSED);
+ pause_requested(control_code);
break;
case SERVICE_CONTROL_CONTINUE:
- report_status(SERVICE_CONTINUE_PENDING);
- this->resume();
- report_status(SERVICE_RUNNING);
+ continue_requested(control_code);
break;
case SERVICE_CONTROL_INTERROGATE:
- report_status(0);
+ interrogate_requested(control_code);
break;
}
@@ -110,6 +105,39 @@ ACE_NT_Service::handle_control (DWORD control_code)
void
+ACE_NT_Service::stop_requested (DWORD)
+{
+ this->report_status (SERVICE_STOP_PENDING);
+ /* how to cancel? */
+}
+
+
+void
+ACE_NT_Service::pause_requested (DWORD)
+{
+ this->report_status (SERVICE_PAUSE_PENDING);
+ this->suspend ();
+ report_status (SERVICE_PAUSED);
+}
+
+
+void
+ACE_NT_Service::continue_requested (DWORD)
+{
+ this->report_status (SERVICE_CONTINUE_PENDING);
+ this->resume ();
+ report_status (SERVICE_RUNNING);
+}
+
+
+void
+ACE_NT_Service::interrogate_requested (DWORD)
+{
+ this->report_status (0);
+}
+
+
+void
ACE_NT_Service::name (LPCTSTR name, LPCTSTR desc)
{
diff --git a/ace/NT_Service.h b/ace/NT_Service.h
index 1a0f67fa1bf..c266454568e 100644
--- a/ace/NT_Service.h
+++ b/ace/NT_Service.h
@@ -270,6 +270,18 @@ protected:
// ACE_Time_Value::zero is passed - it checks the state once but doesn't
// wait after that.
+ virtual void stop_requested (DWORD control_code);
+ // Called by handle_control () when a stop/shutdown was requested.
+
+ virtual void pause_requested (DWORD control_code);
+ // Called by handle_control () when a pause was requested.
+
+ virtual void continue_requested (DWORD control_code);
+ // Called by handle_control () when a continue was requested.
+
+ virtual void interrogate_requested (DWORD control_code);
+ // Called by handle_control () when a interrogate was requested.
+
protected:
DWORD start_time_; // Estimate of init time needed
SERVICE_STATUS_HANDLE svc_handle_; // Service handle - doesn't need close.