public class TimerStateAdapter extends Object implements Stateful
Stateful
that adapts a ParentState
s to
TimerState
s. Required because StateOperator
s provide
ParentState
s but timers need to reflect the child states as a
TimerState
.Constructor and Description |
---|
TimerStateAdapter(Stateful adapting)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addStateListener(StateListener listener)
Add a job state listener.
|
protected StateEvent |
convert(StateEvent event)
Convert the event that is assumed to contain a
ParentState
into an equivalent event that contains a TimerState . |
StateEvent |
lastStateEvent()
Get the last state event.
|
void |
removeStateListener(StateListener listener)
Remove a job state listener.
|
public TimerStateAdapter(Stateful adapting)
adapting
- The Stateful
that provides
ParentState
s.protected StateEvent convert(StateEvent event)
ParentState
into an equivalent event that contains a TimerState
.event
- The original event.public StateEvent lastStateEvent()
Stateful
lastStateEvent
in interface Stateful
public void addStateListener(StateListener listener) throws JobDestroyedException
Stateful
addStateListener
in interface Stateful
listener
- The listener.JobDestroyedException
public void removeStateListener(StateListener listener)
Stateful
removeStateListener
in interface Stateful
listener
- The listener.