public abstract class AbstractImmediateWorker extends AbstractWorker
The business logic of the Worker is inside the forever()
method. It
is executed always called immediately without any delay.
ALWAYS_WAIT_FOR_TRIGGER_NEXT_RUN, DO_NOT_WAIT
Constructor and Description |
---|
AbstractImmediateWorker() |
Modifier and Type | Method and Description |
---|---|
void |
activate(java.lang.String name)
Initializes the worker and starts the worker thread
|
void |
deactivate()
Stops the worker thread
|
protected abstract void |
forever()
This method is called in a loop forever until the Thread gets interrupted.
|
protected int |
getCycleTime()
Gets the cycleTime of this worker in [ms].
|
triggerNextRun
public void activate(java.lang.String name)
AbstractWorker
activate
in class AbstractWorker
public void deactivate()
AbstractWorker
deactivate
in class AbstractWorker
protected final int getCycleTime()
AbstractWorker
getCycleTime
in class AbstractWorker
protected abstract void forever() throws java.lang.InterruptedException
AbstractWorker
forever
in class AbstractWorker
java.lang.InterruptedException