|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.schwarzrot.app.support.AbstractService<C>
C
- - type of configurationpublic abstract class AbstractService<C extends ServiceConfig>
implements the common stuff for services
Constructor Summary | |
---|---|
protected |
AbstractService(C config)
|
protected |
AbstractService(C config,
SystemDefault applicationDefaults)
|
Method Summary | |
---|---|
Map<String,String> |
getAppArgs()
provide access to the expanded arguments of main(String[] args) |
String |
getAppInfo()
print initial startup information |
String |
getAppInfo(String appName)
|
SystemDefault |
getApplicationDefaults()
access the application defaults. |
String |
getApplicationName()
print the application name - may be localized. |
C |
getConfig()
access application starters configuration instance |
protected org.apache.commons.logging.Log |
getLogger()
|
String |
getUserName()
return the name of the applications user. |
boolean |
isShutdownRequested()
will be used by the ServiceStarter , which has the service main
loop. |
void |
setAppArgs(Map<String,String> appArgs)
set expanded arguments of main(String[] args) |
void |
setConfig(C config)
set application starters configuration instance |
void |
setShutdownRequested(boolean shutdown)
setter to request a shutdown of the service from inside. |
void |
setupEarly()
first stage of initialization. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.schwarzrot.app.Service |
---|
isIdle, setupLate |
Methods inherited from interface de.schwarzrot.app.MainEntry |
---|
usage |
Methods inherited from interface java.lang.Runnable |
---|
run |
Constructor Detail |
---|
protected AbstractService(C config)
protected AbstractService(C config, SystemDefault applicationDefaults)
Method Detail |
---|
public Map<String,String> getAppArgs()
MainEntry
getAppArgs
in interface MainEntry<C extends ServiceConfig>
public String getAppInfo()
MainEntry
getAppInfo
in interface MainEntry<C extends ServiceConfig>
public String getAppInfo(String appName)
public final SystemDefault getApplicationDefaults()
MainEntry
getApplicationDefaults
in interface MainEntry<C extends ServiceConfig>
public String getApplicationName()
MainEntry
SystemDefault.applicationID
getApplicationName
in interface MainEntry<C extends ServiceConfig>
public C getConfig()
MainEntry
getConfig
in interface MainEntry<C extends ServiceConfig>
public String getUserName()
UserNameProvider
getUserName
in interface UserNameProvider
public final boolean isShutdownRequested()
Service
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
.
isShutdownRequested
in interface Service<C extends ServiceConfig>
public void setAppArgs(Map<String,String> appArgs)
MainEntry
setAppArgs
in interface MainEntry<C extends ServiceConfig>
appArgs
- arguments from main expanded to key/value pairspublic void setConfig(C config)
MainEntry
setConfig
in interface MainEntry<C extends ServiceConfig>
config
- the configuration instancepublic void setShutdownRequested(boolean shutdown)
Service
System.exit
, but set the shutdownRequested
flag. The ServiceStarter
then cares about shutdown and cleanup.
setShutdownRequested
in interface Service<C extends ServiceConfig>
shutdown
- - set to true
if the service should stoppublic void setupEarly()
Service
setupEarly
in interface Service<C extends ServiceConfig>
protected final org.apache.commons.logging.Log getLogger()
|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |