org.mmbase.applications.crontab
Class CronEntry
java.lang.Object
org.mmbase.applications.crontab.CronEntry
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- NodeCronEntry
public class CronEntry
- extends Object
- implements Serializable
Defines one entry for CronDaemon. This class is used by the CronDaemon.
- Version:
- $Id: CronEntry.java 44148 2010-12-22 09:06:55Z michiel $
- Author:
- Kees Jongenburger, Michiel Meeuwissen
- See Also:
- Serialized Form
|
Constructor Summary |
CronEntry(String id,
String cronTime,
String name,
String className,
String configuration)
|
CronEntry(String id,
String cronTime,
String name,
String className,
String configuration,
CronEntry.Type type)
|
CronEntry(String id,
String cronTime,
String name,
String className,
String configuration,
CronEntry.Type type,
Pattern servers)
|
CronEntry(String id,
String cronTime,
String name,
String className,
String configuration,
String typeString)
|
CronEntry(String id,
String cronTime,
String name,
String className,
String configuration,
String typeString,
Pattern servers)
|
ALL
public static final Pattern ALL
cronTime
protected final String cronTime
lastRun
protected Date lastRun
count
protected int count
lastCost
protected int lastCost
maxDuration
protected long maxDuration
CronEntry
public CronEntry(String id,
String cronTime,
String name,
String className,
String configuration)
throws Exception
- Throws:
Exception
CronEntry
public CronEntry(String id,
String cronTime,
String name,
String className,
String configuration,
String typeString)
throws Exception
- Throws:
Exception
CronEntry
public CronEntry(String id,
String cronTime,
String name,
String className,
String configuration,
String typeString,
Pattern servers)
throws Exception
- Throws:
Exception
CronEntry
public CronEntry(String id,
String cronTime,
String name,
String className,
String configuration,
CronEntry.Type type)
throws Exception
- Throws:
ClassCastException - if className does not refer to a Runnable.
RuntimeException - if the cronTime format isn't correct
Exception
CronEntry
public CronEntry(String id,
String cronTime,
String name,
String className,
String configuration,
CronEntry.Type type,
Pattern servers)
throws Exception
- Throws:
ClassCastException - if className does not refer to a Runnable.
RuntimeException - if the cronTime format isn't correct
Exception
init
public void init()
stop
public void stop()
getThread
public Interruptable getThread(int i)
- Since:
- MMBase-1.8
getThreads
public List<Interruptable> getThreads()
interrupt
public boolean interrupt(int thread)
isAlive
public boolean isAlive(int i)
- Whether a job associated with this cron entry is currently alive on this machine.
- Since:
- MMBase-1.8
isAlive
public boolean isAlive()
isActive
public boolean isActive()
- Whether this Entry would run. It would not run if it is only scheduled to run on other machines.
- Since:
- MMBase-1.8.7
isMustBeOne
public boolean isMustBeOne()
getServers
public String getServers()
- A String indicating on the servers on which this Job must run. This may be regular expression
and used in the implementation of
isActive(), but this is not required.
getExecutable
Interruptable getExecutable()
kick
public boolean kick(Date currentTime)
setCronTime
protected void setCronTime(String cronTime)
getCronTime
public String getCronTime()
getId
public String getId()
getName
public String getName()
setConfiguration
public void setConfiguration(String conf)
getConfiguration
public String getConfiguration()
getType
public CronEntry.Type getType()
getClassName
public String getClassName()
getLastRun
public Date getLastRun()
setLastRun
protected void setLastRun(Date d)
getCount
public int getCount()
incCount
protected void incCount()
getLastCost
public int getLastCost()
setLastCost
protected void setLastCost(int s)
getMaxDuration
public long getMaxDuration()
mustRun
boolean mustRun(Date date)
getMinuteEntry
public CronEntryField getMinuteEntry()
getHourEntry
public CronEntryField getHourEntry()
getDayOfMonthEntry
public CronEntryField getDayOfMonthEntry()
getMonthEntry
public CronEntryField getMonthEntry()
getDayOfWeekEntry
public CronEntryField getDayOfWeekEntry()
toString
public String toString()
- Overrides:
toString in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object o)
- Two CronEntrys as considered equal if they have the same id, name, classname, cronTime and configuration.
- Overrides:
equals in class Object
MMBase Crontab 2.0-SNAPSHOT - 2013-03-30T06:40