public class DefaultTimerControl extends Object implements TimerControl, Consumer<TimerState>
Configuration.configure() for instance by registering the timer plugin as follows:
DefaultTimerControl timerControl = new DefaultTimerControl();
Configuration.configure().plugin(Plugins.timerPlugin(), timerControl);
Other initialisation alternatives are
DefaultTimerControl timerControl = new DefaultTimerControl(new DeadlineHeapTimerState());
Configuration.configure().plugin(Plugins.timerPlugin(), timerControl.timerState);
or also
DefaultTimerControl timerControl = new DefaultTimerControl();
Configuration.configure().plugin(Plugins.timerPlugin(), new DeadlineHeapTimerState(), timerControl);
| Constructor and Description |
|---|
DefaultTimerControl() |
DefaultTimerControl(Context context) |
DefaultTimerControl(TimerState timerState) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(TimerState timerState) |
boolean |
startPeriodic(long id,
int type,
long timeout,
EventRouter eventRouter) |
boolean |
startTimer(long id,
int type,
long timeout,
EventRouter eventRouter) |
boolean |
stopTimer(long id,
EventRouter eventRouter) |
TimerState |
timerState() |
public DefaultTimerControl()
public DefaultTimerControl(Context context)
public DefaultTimerControl(TimerState timerState)
public void accept(TimerState timerState)
accept in interface Consumer<TimerState>public TimerState timerState()
public boolean startTimer(long id,
int type,
long timeout,
EventRouter eventRouter)
startTimer in interface TimerControlpublic boolean startPeriodic(long id,
int type,
long timeout,
EventRouter eventRouter)
startPeriodic in interface TimerControlpublic boolean stopTimer(long id,
EventRouter eventRouter)
stopTimer in interface TimerControlCopyright © 2020 tools4j.org (Marco Terzer, Anton Anufriev). All Rights Reserved.