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)
Clock
scheduleAlarm
in interface Clock
offset
- 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()
Clock
public void stop(Throwable stopOnException)
Clock
public void close()
Clock
close
in interface AutoCloseable
close
in interface Clock
public boolean isIdle()
Clock
Copyright © 2016 The Apache Software Foundation. All rights reserved.