|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
C
- - service configuration entitypublic interface Service<C extends ServiceConfig>
provides the operating system view of a background-task/system service. A
Service
will be startet by a ServiceStarter
, which cares
about the interface to operating system. The Service
itself can focus
on the view, what should be done.
setup
is an asynchronous initialization entry, which will be called
independant of the services constructor. When setup
gets called, the
service is already daemonized and running.
The ServiceStarter
provides property-parsing, as well as the services
main loop. So the service implementation should not contain a loop.
run
should be sequential processing, which can be executed
cyclically.
Method Summary | |
---|---|
boolean |
isIdle()
will be used by the ServiceLauncher to determine, whether it
should sleep between the calls to Service.run() . |
boolean |
isShutdownRequested()
will be used by the ServiceStarter , which has the service main
loop. |
void |
setShutdownRequested(boolean shutdown)
setter to request a shutdown of the service from inside. |
void |
setupEarly()
first stage of initialization. |
void |
setupLate()
second stage of initialization. |
Methods inherited from interface de.schwarzrot.app.MainEntry |
---|
getAppArgs, getAppInfo, getApplicationDefaults, getApplicationName, getConfig, setAppArgs, setConfig, usage |
Methods inherited from interface java.lang.Runnable |
---|
run |
Methods inherited from interface de.schwarzrot.data.access.UserNameProvider |
---|
getUserName |
Method Detail |
---|
boolean isIdle()
ServiceLauncher
to determine, whether it
should sleep between the calls to Service.run()
.
boolean isShutdownRequested()
ServiceStarter
, which has the service main
loop. A request to terminate a service may be come from inside (the
service itself) or from outside (the os-user). The ServiceStarter
cares about the outside world and the service may trigger a shutdown by
setting shutdownRequested
to true
.
void setShutdownRequested(boolean shutdown)
System.exit
, but set the shutdownRequested
flag. The ServiceStarter
then cares about shutdown and cleanup.
shutdown
- - set to true
if the service should stopvoid setupEarly()
void setupLate()
|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |