org.jcrontab
Class Cron

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.jcrontab.Cron
All Implemented Interfaces:
java.lang.Runnable

public class Cron
extends java.lang.Thread

This class represents the Thread that loads the information from the DAO's and maintains the list of events to execute by the Crontab.

Version:
$Revision: 1.50 $
Author:
$Author: iolalla $

Field Summary
static java.util.Properties prop
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Cron()
          Constructor of a Cron.
Cron(Crontab cront, int iTimeTableGenerationFrec)
          Constructor of a Cron
 
Method Summary
 void generateEvents()
          Generates new time table entries (for new events).
 void run()
          105a160,166 Runs the Cron Thread.
static void stopInTheNextMinute()
          Tell The system that should stop
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

prop

public static java.util.Properties prop
Constructor Detail

Cron

public Cron()
Constructor of a Cron. This one doesn't receive any parameters to make it easier to build an instance of Cron


Cron

public Cron(Crontab cront,
            int iTimeTableGenerationFrec)
Constructor of a Cron

Parameters:
cront - Crontab The Crontab that the cron must call to generate new tasks
iTimeTableGenerationFrec - int Frecuency of generation of new time table entries.
Method Detail

run

public void run()
105a160,166 Runs the Cron Thread. This method is the method called by the crontab class. this method is inherited from Thread Class

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

stopInTheNextMinute

public static void stopInTheNextMinute()
Tell The system that should stop

Returns:
CrontabEntryBean[] the resultant array of CrontabEntryBean
Throws:
java.lang.Exception

generateEvents

public void generateEvents()
Generates new time table entries (for new events). IN fact this method does more or less everything, this method tells the DAO to look for CrontabEntryArray, generates the CrontabBeans and puts itself as the last event to generate again the list of events. Nice Method. :-)