|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.TimerTask
dsto.dfc.util.TimerCallback
public class TimerCallback
Used to deliver an event from java.util.Timer. This can be used to shunt an event from a one thread to be re-delivered in another.
Example usage:
public void propertyValueChanged (PropertyChangeEvent e) { Timer timer = java.util.Timers.getTimer (false); timer.schedule (new TimerEventCallback (this, "propertyValueChanged", e), 0); }or (shorter and equivalently)
TimerEventCallback.schedule (this, "propertyValueChanged", e);
Constructor Summary | |
---|---|
TimerCallback(Object target,
String methodName,
Object param)
Create a new instance. |
Method Summary | |
---|---|
void |
run()
|
static void |
schedule(Object target,
String methodName,
Object param)
Shortcut to schedule an event in the shared non-daemon timer available from Timers.getTimer(boolean) . |
static void |
schedule(Object target,
String methodName,
Object param,
long delayMillis)
Shortcut to schedule an event in the shared daemon timer available from Timers.getTimer(boolean) . |
Methods inherited from class java.util.TimerTask |
---|
cancel, scheduledExecutionTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimerCallback(Object target, String methodName, Object param) throws IllegalArgumentException
target
- The target object to invoke the event on.methodName
- The name of the event handling method on target.param
- The parameter object.
IllegalArgumentException
- if method does not exist.schedule(Object, String, Object)
Method Detail |
---|
public static void schedule(Object target, String methodName, Object param) throws IllegalArgumentException
Timers.getTimer(boolean)
.
target
- The target object to invoke the event on.methodName
- The name of the event handling method on target.param
- The parameter object.
IllegalArgumentException
- if method does not exist.schedule(Object, String, Object, long)
public static void schedule(Object target, String methodName, Object param, long delayMillis) throws IllegalArgumentException
Timers.getTimer(boolean)
.
target
- The target object to invoke the event on.methodName
- The name of the event handling method on target.param
- The parameter object.delayMillis
- Delay in milliseconds.
IllegalArgumentException
- if method does not exist.schedule(Object, String, Object)
public void run()
run
in interface Runnable
run
in class TimerTask
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |