public class CronDaemon extends Object implements ProposedJobs.Listener, Events.Listener
| Modifier and Type | Method and Description |
|---|---|
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() |
public void notify(ProposedJobs.Event event)
notify in interface ProposedJobs.Listenerpublic void notify(Events.Event event)
notify in interface Events.Listenerprotected 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 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()
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}