|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jetrix.services.AbstractService
net.jetrix.services.ScheduledService
public abstract class ScheduledService
A service running a task at a fixed rate. Services based on ScheduledService expect a delay parameter for the delay in milliseconds before the task is first executed, and a period parameter for the time in milliseconds between successive executions of the task.
Field Summary |
---|
Fields inherited from class net.jetrix.services.AbstractService |
---|
autoStart, log |
Constructor Summary | |
---|---|
ScheduledService()
|
Method Summary | |
---|---|
long |
getDelay()
Get the delay in milliseconds before the task is first executed. |
long |
getPeriod()
Get the time in milliseconds between successive executions of the task. |
protected void |
init()
Initialization performed before the timer is started. |
boolean |
isRunning()
Check is the service is running. |
protected abstract void |
run()
Execute the task |
void |
setDelay(long delay)
Set the delay in milliseconds before the task is first executed. |
void |
setPeriod(long period)
Set the time in milliseconds between successive executions of the task. |
void |
start()
Start the service. |
void |
stop()
Stop the service. |
Methods inherited from class net.jetrix.services.AbstractService |
---|
isAutoStart, setAutoStart |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.jetrix.Service |
---|
getName |
Constructor Detail |
---|
public ScheduledService()
Method Detail |
---|
protected void init()
public void start()
Service
public void stop()
Service
public boolean isRunning()
protected abstract void run()
public long getPeriod()
public void setPeriod(long period)
public long getDelay()
public void setDelay(long delay)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |