public interface NurseryService
Interface to represent a Nursery
Service. Provides two methods that peform operations which were previously performed implicitly: doStartService()
starts the service, and doStopService()
stops the service.
Use of this interface is optional. Nursery
will call doStartService()
and doStopService()
regardless.
Modifier and Type | Method and Description |
---|---|
void |
doStartService()
This method is called after a
NurseryService has been created, placed in Nursery , and initialized with its configured property values. |
void |
doStopService()
This method is called whenever
Nursery determines that a NurseryService must be shut down. |
void doStartService() throws Exception
This method is called after a NurseryService
has been created, placed in Nursery
, and initialized with its configured property values.
The NurseryService
can override this method to start any processes it requires.
This method is also called when a NurseryService
is reconfigured. In such cases, doStopService()
is called, then the appropriate properties are
set with the new configuration values, and doStartService()
is called.
Exception
- when an error occurs while attempting to start the NurseryService
void doStopService() throws Exception
This method is called whenever Nursery
determines that a NurseryService
must be shut down. This may happen due to an explicit
command from the administrator, or it may happen because Nursery
is shutting down. The NurseryService
should respond by stopping
any processes that it has started.
This method is also called when a NurseryService
is reconfigured. In such cases, doStopService()
is called, then the appropriate properties are
set with the new configuration values, and doStartService()
is called.
Exception
- when an error occurs while attempting to stop the NurseryService
© 1998- 2021 Escenic AS