Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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` | `close()` Closes the cron instance
`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.

### close

    public void close()

  Closes the cron instance

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD