|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.asyncobjects.util.timer.TimerUtils
public class TimerUtils
Timer utils that provide simplified interface.
Constructor Summary | |
---|---|
TimerUtils()
|
Method Summary | ||
---|---|---|
static
|
delayFor(ATimer timer,
long delay,
Promise<T> value)
Delay returning value until spefied time |
|
static
|
delayFor(ATimer timer,
long delay,
T value)
Delay returning value until spefied time |
|
static
|
delayUntil(ATimer timer,
Date time,
Promise<T> value)
Delay returning value until spefied time |
|
static
|
delayUntil(ATimer timer,
Date time,
T value)
Delay returning value until spefied time |
|
static Promise<Void> |
sleepFor(ATimer timer,
long ms)
Sleep the specified amount of milliseconds |
|
static Promise<Void> |
sleepUntil(ATimer timer,
Date time)
Sleep the specified amount of milliseconds |
|
static
|
timeout(ATimer timer,
long delay,
Throwable t)
Smash result promise with the specified exception after specified time |
|
static
|
timeoutAt(ATimer timer,
Date time,
Throwable t)
Smash result promise with the specified exception after specified time |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimerUtils()
Method Detail |
---|
public static Promise<Void> sleepFor(ATimer timer, long ms)
timer
- a timer to usems
- milliseconds to sleep
public static Promise<Void> sleepUntil(ATimer timer, Date time)
timer
- a timer to usetime
- a time to to awaken
public static <T> Promise<T> delayUntil(ATimer timer, Date time, T value)
T
- a type of valuetimer
- a timer to usetime
- a time to to awakenvalue
- a value to return
public static <T> Promise<T> delayUntil(ATimer timer, Date time, Promise<T> value)
T
- a type of valuetimer
- a timer to usetime
- a time to to awakenvalue
- a value to return
public static <T> Promise<T> delayFor(ATimer timer, long delay, T value)
T
- a type of valuetimer
- a timer to usedelay
- a delay to waitvalue
- a value to return
public static <T> Promise<T> delayFor(ATimer timer, long delay, Promise<T> value)
T
- a type of valuetimer
- a timer to usedelay
- a delay to waitvalue
- a value to return
public static <T> Promise<T> timeoutAt(ATimer timer, Date time, Throwable t)
T
- a promise typetimer
- a timer to usetime
- a time to to timeoutt
- a problem to smash promise with
public static <T> Promise<T> timeout(ATimer timer, long delay, Throwable t)
T
- a promise typetimer
- a timer to usedelay
- a delay before timeoutt
- a problem to smash promise with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |