public abstract class AbstractServiceDaemon extends Object implements ServiceDaemon, SpringServiceDaemon
Abstract AbstractServiceDaemon class.
PAUSE_PENDING, PAUSED, RESUME_PENDING
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
Modifier | Constructor and Description |
---|---|
protected |
AbstractServiceDaemon(String name)
Constructor for AbstractServiceDaemon.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
afterPropertiesSet
|
protected void |
debugf(String format,
Object... args)
debugf
|
protected void |
debugf(Throwable t,
String format,
Object... args)
debugf
|
protected void |
errorf(String format,
Object... args)
errorf
|
protected void |
errorf(Throwable t,
String format,
Object... args)
errorf
|
protected void |
fatalf(String format,
Object... args)
fatalf
|
protected void |
fatalf(Throwable t,
String format,
Object... args)
fatalf
|
String |
getName()
getName
|
int |
getStatus()
getStatus
|
String |
getStatusText()
getStatusText
|
protected void |
infof(String format,
Object... args)
infof
|
protected void |
infof(Throwable t,
String format,
Object... args)
infof
|
void |
init()
init
|
protected boolean |
isPaused()
isPaused
|
protected boolean |
isRunning()
isRunning
|
protected boolean |
isStarting()
isStarting
|
protected boolean |
isStartPending()
isStartPending
|
protected ThreadCategory |
log()
log
|
protected abstract void |
onInit()
onInit
|
protected void |
onPause()
onPause
|
protected void |
onResume()
onResume
|
protected void |
onStart()
onStart
|
protected void |
onStop()
onStop
|
void |
pause()
pause
|
void |
resume()
resume
|
protected void |
setStatus(int status)
setStatus
|
void |
start()
start
|
String |
status()
status
|
void |
stop()
Stops the currently running service.
|
protected void |
waitForStatus(int status)
waitForStatus
|
protected void |
waitForStatus(int status,
long timeout)
waitForStatus
|
protected void |
warnf(String format,
Object... args)
warnf
|
protected void |
warnf(Throwable t,
String format,
Object... args)
warnf
|
public final void afterPropertiesSet() throws Exception
afterPropertiesSet
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
- if any.protected abstract void onInit()
onInit
protected void onPause()
onPause
protected void onResume()
onResume
protected void onStart()
onStart
protected void onStop()
onStop
public final String getName()
getName
protected void setStatus(int status)
setStatus
status
- a int.protected void waitForStatus(int status, long timeout) throws InterruptedException
waitForStatus
status
- a int.timeout
- a long.InterruptedException
- if any.protected void waitForStatus(int status) throws InterruptedException
waitForStatus
status
- a int.InterruptedException
- if any.public int getStatus()
getStatus
public String status()
status
status
in interface ServiceDaemon
String
object.protected boolean isStartPending()
isStartPending
protected boolean isRunning()
isRunning
protected boolean isPaused()
isPaused
protected boolean isStarting()
isStarting
protected ThreadCategory log()
log
ThreadCategory
object.public final void init()
init
public final void pause()
pause
pause
in interface PausableFiber
public final void resume()
resume
resume
in interface PausableFiber
public final void start()
start
start
in interface Fiber
start
in interface SpringServiceDaemon
Copyright © 2015. All Rights Reserved.