|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.mmbase.applications.crontab.CronDaemon
public class CronDaemon
CronDaemon is a "crontab" clone written in java. The daemon starts a thread that wakes up every minute (it keeps sync by calculating the time to sleep)
| Method Summary | |
|---|---|
void |
add(CronEntry entry)
Adds the given CronEntry to this daemon. |
protected void |
addEntry(CronEntry entry)
Actually adds, no checks for 'removedEntries' and so on. |
void |
clear()
Clears all queues |
protected void |
consumeJobs()
Consumes received job proposals |
protected void |
detectFailedJobs()
|
protected static CronEntry |
getById(Set<CronEntry> set,
String id)
Finds in given set the CronEntry with the given id. |
CronEntry |
getCronEntry(String id)
|
Set<CronEntry> |
getEntries()
|
protected long |
getFirst()
|
static CronDaemon |
getInstance()
Singleton, Gets (and instantiates, and starts) the one CronDaemon instance. |
List<ProposedJobs.Event> |
getQueue()
|
List<RunningCronEntry> |
getRunning()
|
boolean |
interrupt(String machine,
String entry,
int id)
|
boolean |
isAlive()
|
static void |
main(String[] argv)
main only for testing purposes |
void |
notify(Events.Event event)
|
void |
notify(ProposedJobs.Event event)
|
void |
remove(CronEntry entry)
Remove the given CronEntry from this daemon. |
protected void |
removeEntry(CronEntry entry)
Actually removes, nor checks for removedEntries' and so on. |
protected void |
run()
The main loop of the daemon. |
void |
start()
Starts the daemon, which you might want to do if you have stopped if for some reason. |
void |
stop()
If you like to temporary stop the daemon, call this. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void notify(ProposedJobs.Event event)
notify in interface ProposedJobs.Listenerpublic void notify(Events.Event event)
notify in interface Events.Listener
public boolean interrupt(String machine,
String entry,
int id)
protected void consumeJobs()
public List<ProposedJobs.Event> getQueue()
public List<RunningCronEntry> getRunning()
protected void detectFailedJobs()
protected static CronEntry getById(Set<CronEntry> set,
String id)
null otherwise.public void add(CronEntry entry)
RuntimeException - If an entry with the same id is present already (unless it is running and scheduled for removal already)protected void addEntry(CronEntry entry)
public CronEntry getCronEntry(String id)
public void remove(CronEntry entry)
protected void removeEntry(CronEntry entry)
protected long getFirst()
public void start()
public void stop()
public boolean isAlive()
public static CronDaemon getInstance()
protected void run()
public void clear()
public Set<CronEntry> getEntries()
public String toString()
toString in class Object
public static void main(String[] argv)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||