Stop
Command Reference
Description
Stop the service process.
Service provides the concrete implementation supporting the generic shutdown algorithm which first checks if the service is down, and if not, to then run the stopService method.
The standard Service algorithm to shut down a service can be maintained inspite of exceptional scenarios particular to a service. The graphic below describes the logic for shutting down a Jakarta Tomcat service. In this example, the stopService command is changed into a command workflow which first attempts to stop tomcat by sending the SHUTDOWN message to the control port. If that fails, it then invokes the runShutdownScript command which then attempts to stop the service by calling the tomcat shutdown script.
One can imagine how they can use this pattern to extend components of the startup and shutdown workflow to incorporate special logic yet still work within the basic logical skelaton provided by Service.