Modifier and Type | Class and Description |
---|---|
(package private) class |
DaemonWrapper.Invoker |
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ARGS |
private DaemonConfiguration |
config |
private java.lang.String |
configFileName |
private DaemonWrapper.Invoker |
shutdown |
private static java.lang.String |
START_CLASS |
private static java.lang.String |
START_METHOD |
private DaemonWrapper.Invoker |
startup |
private static java.lang.String |
STOP_ARGS |
private static java.lang.String |
STOP_CLASS |
private static java.lang.String |
STOP_METHOD |
Constructor and Description |
---|
DaemonWrapper() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Frees any resources allocated by this daemon such as file
descriptors or sockets.
|
void |
init(DaemonContext context)
Called from DaemonLoader on init stage.
|
void |
start()
Starts the operation of this
Daemon instance. |
void |
stop()
Stops the operation of this
Daemon instance. |
private static final java.lang.String ARGS
private static final java.lang.String START_CLASS
private static final java.lang.String START_METHOD
private static final java.lang.String STOP_CLASS
private static final java.lang.String STOP_METHOD
private static final java.lang.String STOP_ARGS
private java.lang.String configFileName
private final DaemonConfiguration config
private final DaemonWrapper.Invoker startup
private final DaemonWrapper.Invoker shutdown
public void init(DaemonContext context) throws java.lang.Exception
Accepts the following configuration arguments:
The following "-daemon-properties" are recognized:
init
in interface Daemon
context
- A DaemonContext
object used to
communicate with the container.DaemonInitException
- An exception that prevented
initialization where you want to display a nice message to the user,
rather than a stack trace.java.lang.Exception
- Any exception preventing a successful
initialization.public void start() throws java.lang.Exception
Daemon
Daemon
instance. This
method is to be invoked by the environment after the init()
method has been successfully invoked and possibly the security
level of the JVM has been dropped. Implementors of this
method are free to start any number of threads, but need to
return control after having done that to enable invocation of
the stop()-method.public void stop() throws java.lang.Exception
Daemon
Daemon
instance. Note
that the proper place to free any allocated resources such as
sockets or file descriptors is in the destroy method, as the
container may restart the Daemon by calling start() after
stop().public void destroy()
Daemon