|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.zos.jdl.Timer
public class Timer
Timer schedules a callback to a Job or Joblet method.
Timers can schedule a one time or a repeated callback on an interval basis.
An active Timer will keep the Job or Joblet running. You must manually cancel or
terminate the Job or Joblet or invoke the Timer's cancel()
method.
Example to setup a Timer callback every 5 seconds. This Job will remain running subject to job timeout.
class timer(Job): def job_started_event(self): print "Started %s" % self.getFact("job.id") timer = Timer(self.timer_callback, 0, 5) def timer_callback(self): print "timer callback invoked"
Constructor Summary | |
---|---|
Timer(org.python.core.PyMethod method,
int delay)
Construct a one-time Timer instance |
|
Timer(org.python.core.PyMethod method,
int delay,
int interval)
Construct a Timer that repeatedly calls the method. |
Method Summary | |
---|---|
void |
cancel()
Stop this timer from repeating. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Timer(org.python.core.PyMethod method, int delay)
method
- Method to call after delaydelay
- Seconds to wait before invoking methodpublic Timer(org.python.core.PyMethod method, int delay, int interval)
method
- Method to call at intervalsdelay
- Seconds to wait before starting timerinterval
- Seconds between when method is calledMethod Detail |
---|
public void cancel()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |