The Service Class contains the following fields.
ACCEPT_PAUSE_CONTINUE | Indicates that the service accepts pause and continue requests. |
ACCEPT_SHUTDOWN | Indicates that the service accepts shutdown requests. |
ACCEPT_STOP | Indicates that the service accepts stop requests. |
CONTINUE_PENDING | Indicates that the service is changing its state from pause to run. |
disableassassin | When true, prevents the assassin from being activated. The assassin ensures that the service actually stops when instructed to do so. This deactivates the assassins for each service in the process.
Note As of SDK for Java version 2.02, each service has its own assassin, which can be disabled by calling disableAssassin. All assassins can be globally disabled by calling disableAllAssassins. |
err | An error output stream for the service. Data written to the stream is automatically redirected to the event log as error events using the event source specified to jntsvc. Each line printed to the stream results in a new event. Multiple lines can be written by synchronizing on this object and using setServiceAutoDumpErr to temporarily turn off auto-logging, as shown in the following example:
Examplesynchronized (err) { boolean oldautodump = setServiceAutoDumpErr(false); err.println("Line 1"); err.println("Line 2"); setServiceAutoDumpErr(oldautodump); err.flush(); } |
ERROR_SERVICE_SPECIFIC_ERROR | Service-specific error reported. This is set in ServiceStatus.Win32ExitCode to indicate that an error has occurred. |
NO_ERROR | No error reported. This is set in ServiceStatus.Win32ExitCode to indicate that the service terminated correctly. |
out | A standard output stream for the service. Data written to the stream is automatically redirected to the event log using the event source specified to the jntsvc tool. Each line printed to the stream results in a new event. Multiple lines can be written by synchronizing on this object and using setServiceAutoDumpOut to temporarily turn off auto-logging, as shown in the following example:
Examplesynchronized (out) { boolean oldautodump = setServiceAutoDumpOut(false); out.println("Line 1"); out.println("Line 2"); setServiceAutoDumpOut(oldautodump); out.flush(); } |
PAUSE_PENDING | Indicates that the service is changing its state from run to pause. |
PAUSED | Indicates that the service is paused. |
RUNNING | Indicates that the service is running. |
START_PENDING | Indicates that the service is starting. |
STOP_PENDING | Indicates that the service is stopping. |
STOPPED | Indicates that the service has stopped. |