org.mmbase.applications.crontab.builders
Class CronJobs

java.lang.Object
  extended byorg.mmbase.util.functions.FunctionProvider
      extended byorg.mmbase.module.core.MMTable
          extended byorg.mmbase.module.core.MMObjectBuilder
              extended byorg.mmbase.applications.crontab.builders.CronJobs
All Implemented Interfaces:
EventListener, NodeEventListener, RelationEventListener, Runnable

public class CronJobs
extends MMObjectBuilder
implements Runnable

Builder that holds cronjobs and listens to changes. The builder also starts the CronDeamon. on startup the list of cronjobs is loaded into memory. The builder uses the bridge to get a cloud using class security.

Author:
Kees Jongenburger

Field Summary
 
Fields inherited from class org.mmbase.module.core.MMObjectBuilder
AGE_PARAMETERS, broadCastChanges, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, EVENT_TYPE_LOCAL, EVENT_TYPE_REMOTE, FIELD_NUMBER, FIELD_OBJECT_TYPE, FIELD_OWNER, fields, genericBlobCache, getFunctions, GUI_PARAMETERS, guiFunction, infoFunction, internalVersion, nodeCache, oType, searchAge, SYSTEM_OWNER, TEMPNODE_DEFAULT_SIZE, temporaryNodes, TMP_FIELD_NUMBER, virtual, WRAP_PARAMETERS, wrapFunction
 
Fields inherited from class org.mmbase.module.core.MMTable
maxNodesFromQuery, mmb, storageConnector, tableName
 
Fields inherited from class org.mmbase.util.functions.FunctionProvider
functions
 
Constructor Summary
CronJobs()
           
 
Method Summary
 boolean commit(MMObjectNode objectNodenode)
          Commits a cronjob to the database.
 int insert(String owner, MMObjectNode objectNodenode)
          Inserts a cronjob into the database, and create and adds a cronEntry to the CronDeamon
 void removeNode(MMObjectNode objectNodenode)
          removes the node from the database and also removes it from the CronDaemon
 void run()
          This thread wait's for MMBase to be started and then adds all the crontEntries to the CronDaemon
 void setDefaults(MMObjectNode node)
          sets the default type and crontime (does not work)
 
Methods inherited from class org.mmbase.module.core.MMObjectBuilder
addEventListener, addField, addLocalObserver, addRemoteObserver, broadcastChanges, checkAddTmpField, clearBlobCache, create, createAlias, createAlias, delete, equals, equals, executeFunction, executeFunction, fieldLocalChanged, getAncestors, getBlobCache, getClassName, getConfigFile, getConfigResource, getDataTypeCollector, getDBKey, getDBState, getDBType, getDefaultTeaser, getDefaultUrl, getDescendants, getDescription, getDescription, getDescriptions, getEditFields, getEmptyNode, getField, getFieldNames, getFields, getFields, getFunction, getFunctionParameters, getFunctions, getGUIIndicator, getGUIIndicator, getGUIIndicator, getHardNode, getHardNode, getHTML, getInitParameter, getInitParameters, getInternalVersion, getList, getLocaleGUIIndicator, getLocaleGUIIndicator, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNextField, getNode, getNode, getNode, getNodeFromCache, getNodeGUIIndicator, getNumber, getObjectType, getObjectValue, getParentBuilder, getPluralName, getPluralName, getPluralNames, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getSortedFields, getSortedListFields, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, hasField, hashCode, hashCode, hostname_function, init, insert, isExtensionOf, isNodeCached, isVirtual, newFunctionInstance, nodeLocalChanged, nodeRemoteChanged, notify, notify, preCommit, process, putTmpNode, removeEventListener, removeField, removeLocalObserver, removeRelations, removeRemoteObserver, removeSyncNodes, removeTmpNode, replace, safeCache, sendFieldChangeSignal, setDescription, setDescriptions, setFields, setInitParameter, setMaintainer, setParentBuilder, setPluralNames, setSearchAge, setSingularNames, setUniqueValue, setUniqueValue, setValue, setValue, setVersion, setXMLPath, testValidData, toString, toString, update, updateFields, wrap
 
Methods inherited from class org.mmbase.module.core.MMTable
count, count, created, getFullTableName, getMMBase, getNode, getNodes, getNodes, getNodes, getNodeType, getStorageConnector, getTableName, search, searchVector, setMMBase, setTableName, size
 
Methods inherited from class org.mmbase.util.functions.FunctionProvider
addFunction, createParameters, getFunction, getFunctions, getFunctionValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CronJobs

public CronJobs()
Method Detail

run

public void run()
This thread wait's for MMBase to be started and then adds all the crontEntries to the CronDaemon

Specified by:
run in interface Runnable

insert

public int insert(String owner,
                  MMObjectNode objectNodenode)
Inserts a cronjob into the database, and create and adds a cronEntry to the CronDeamon

Overrides:
insert in class MMObjectBuilder
Parameters:
owner - The administrator creating the node
objectNodenode - The object to insert. The object need be of the same type as the current builder.
Returns:
An int value which is the new object's unique number, -1 if the insert failed.

commit

public boolean commit(MMObjectNode objectNodenode)
Commits a cronjob to the database. On commit of a cronjob, the job is first removed from the cronDeamon and a new cronEntry is created and added to the CronDaemon.

Overrides:
commit in class MMObjectBuilder
Parameters:
objectNodenode - The node to be committed
Returns:
true if commit successful

removeNode

public void removeNode(MMObjectNode objectNodenode)
removes the node from the database and also removes it from the CronDaemon

Overrides:
removeNode in class MMObjectBuilder
Parameters:
objectNodenode - The node to remove.

setDefaults

public void setDefaults(MMObjectNode node)
sets the default type and crontime (does not work)

Overrides:
setDefaults in class MMObjectBuilder
Parameters:
node - The node to set the defaults of.


MMBase build 1.8.1.20060716