com.caucho.util
Class Cron

java.lang.Object
  |
  +--com.caucho.util.Cron

public class Cron
extends java.lang.Object

The cron class provides a lightweight event scheduler. This allows an objects to schedule a timeout without creating a new thread.

Cron should be used for slower requests.

A separate thread periodically tests the queue for crons ready.


Constructor Summary
Cron(CronListener listener)
          Create a new wakeup cron with a designated listener as a callback.
Cron(CronListener listener, java.lang.String name)
          Create a new wakeup cron with a designated listener as a callback.
 
Method Summary
 void dequeue()
          Remove the cron from the wakeup queue.
 CronListener getListener()
          Return the cron's listener.
 void queue()
          Queue the cron for wakeup.
 void setListener(CronListener listener)
          Sets the cron's listener.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cron

public Cron(CronListener listener,
            java.lang.String name)
Create a new wakeup cron with a designated listener as a callback. The cron is not scheduled.

Cron

public Cron(CronListener listener)
Create a new wakeup cron with a designated listener as a callback. The cron is not scheduled.
Method Detail

getListener

public CronListener getListener()
Return the cron's listener.

setListener

public void setListener(CronListener listener)
Sets the cron's listener.

queue

public void queue()
Queue the cron for wakeup.

dequeue

public void dequeue()
Remove the cron from the wakeup queue.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object