public final class RuntimeClock extends Object implements Clock
Clock.IdleHandler, Clock.RuntimeStartHandler, Clock.RuntimeStopHandler, Clock.StartHandler, Clock.StopHandler| Modifier and Type | Method and Description |
|---|---|
void |
close()
This will stop the clock after all client alarms
finish executing.
|
boolean |
isIdle()
Clock is idle if it has no future Alarms set.
|
void |
registerEventHandler(Class<? extends Time> clazz,
EventHandler<Time> handler) |
void |
run() |
void |
scheduleAlarm(int offset,
EventHandler<Alarm> handler)
Schedule a TimerEvent at the given future offset.
|
void |
scheduleRuntimeAlarm(int offset,
EventHandler<Alarm> handler) |
void |
stop()
This stops the clock immediately, without waiting for
client alarms to finish.
|
void |
stop(Throwable stopOnException)
This stops the clock immediately, without waiting for
client alarms to finish.
|
public void scheduleAlarm(int offset, EventHandler<Alarm> handler)
ClockscheduleAlarm in interface Clockoffset - into the futurehandler - to be calledpublic void registerEventHandler(Class<? extends Time> clazz, EventHandler<Time> handler)
public void scheduleRuntimeAlarm(int offset, EventHandler<Alarm> handler)
public void stop()
Clockpublic void stop(Throwable stopOnException)
Clockpublic void close()
Clockclose in interface AutoCloseableclose in interface Clockpublic boolean isIdle()
ClockCopyright © 2016 The Apache Software Foundation. All rights reserved.