org.mmbase.applications.crontab.modules
Class CrontabModule

java.lang.Object
  extended by org.mmbase.util.functions.FunctionProvider
      extended by org.mmbase.util.functions.DescribedFunctionProvider
          extended by org.mmbase.module.Module
              extended by org.mmbase.module.ReloadableModule
                  extended by org.mmbase.module.WatchedReloadableModule
                      extended by org.mmbase.applications.crontab.modules.CrontabModule
All Implemented Interfaces:
Descriptor

public class CrontabModule
extends WatchedReloadableModule

Starts a crontab for MMBase as a Module.

Version:
$Id: CrontabModule.java 42996 2010-07-29 10:13:35Z michiel $
Author:
Michiel Meeuwissen

Field Summary
protected  Function<Boolean> aliveFunction
           
protected  CronDaemon cronDaemon
           
static Parameter<String> ENTRY
           
 Function<Boolean> interruptFunction
           
protected  Function<Boolean> kickFunction
           
protected  Function<Set<CronEntry>> listFunction
           
static Parameter<String> MACHINE
           
protected  Function<Boolean> reloadFunction
           
protected  Function<Boolean> startFunction
           
protected  Function<Boolean> stopFunction
           
static Parameter<Integer> THREAD
           
 
Fields inherited from class org.mmbase.module.Module
configurationPath, getMaintainerFunction, getVersionFunction, properties, STATE_START_TIME
 
Fields inherited from class org.mmbase.util.functions.DescribedFunctionProvider
description, guiName, name
 
Fields inherited from class org.mmbase.util.functions.FunctionProvider
functions, getFunctions
 
Constructor Summary
CrontabModule()
           
 
Method Summary
protected  void addJob(Map.Entry<String,String> entry)
           
 void init()
          Interpretates all initParameters as crontab entries.
 void readMoreJobs()
           
 void reload()
          All previously added entries are removed from the cron-daemon and the currently configured ones are added (init is called).
protected  void shutdown()
          Shuts down the module.
 
Methods inherited from class org.mmbase.module.WatchedReloadableModule
onload
 
Methods inherited from class org.mmbase.module.ReloadableModule
reloadConfiguration, reloadConfiguration
 
Methods inherited from class org.mmbase.module.Module
addInitParameters, checkModules, getInitParameter, getInitParameter, getInitParameter, getInitParameters, getInitParameters, getMaintainer, getModule, getModule, getModule, getModule, getModuleInfo, getModuleLoader, getModuleReader, getModuleReader, getModules, getState, getStates, getVersion, hasModule, hasStarted, loadInitParameters, loadInitParameters, maintainance, setInitParameter, setMaintainer, setState, setVersion, shutdownModules, startModule, startModules
 
Methods inherited from class org.mmbase.util.functions.DescribedFunctionProvider
getDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName, setName
 
Methods inherited from class org.mmbase.util.functions.FunctionProvider
addFunction, createParameters, getFunction, getFunctions, getFunctionValue, newFunctionInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cronDaemon

protected final CronDaemon cronDaemon

listFunction

protected Function<Set<CronEntry>> listFunction
Since:
MMBase-1.8

ENTRY

public static final Parameter<String> ENTRY

THREAD

public static final Parameter<Integer> THREAD

MACHINE

public static final Parameter<String> MACHINE

kickFunction

protected Function<Boolean> kickFunction
Since:
MMBase-1.8

interruptFunction

public Function<Boolean> interruptFunction
Since:
MMBase-1.8

aliveFunction

protected Function<Boolean> aliveFunction
Since:
MMBase-1.8

stopFunction

protected Function<Boolean> stopFunction
Since:
MMBase-1.8

startFunction

protected Function<Boolean> startFunction
Since:
MMBase-1.8

reloadFunction

protected Function<Boolean> reloadFunction
Since:
MMBase-1.8
Constructor Detail

CrontabModule

public CrontabModule()
Method Detail

init

public void init()
Interpretates all initParameters as crontab entries. The key is not very important but must be unique. The value are actually two or three or four values, separated by tabs newlines or '|', whatever you like most.
      <cron time>
      <class name of a CronJob>
      [<description>]
      [<configuration-string>]
      

Overrides:
init in class Module

shutdown

protected void shutdown()
Description copied from class: Module
Shuts down the module. This method is called by shutdownModules.

Overrides:
shutdown in class Module

addJob

protected void addJob(Map.Entry<String,String> entry)

reload

public void reload()
All previously added entries are removed from the cron-daemon and the currently configured ones are added (init is called).

Specified by:
reload in class ReloadableModule

readMoreJobs

public void readMoreJobs()


MMBase 2.0-SNAPSHOT - null