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.
|
public final void scheduleAlarm(int offset, EventHandler<Alarm> handler)
Clock
scheduleAlarm
in interface Clock
offset
- into the futurehandler
- to be calledpublic final void registerEventHandler(Class<? extends Time> clazz, EventHandler<Time> handler)
public final void scheduleRuntimeAlarm(int offset, EventHandler<Alarm> handler)
public final void stop()
Clock
public final void close()
Clock
close
in interface AutoCloseable
close
in interface Clock
public final boolean isIdle()
Clock
Copyright © 2015 The Apache Software Foundation. All rights reserved.