Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.util
Class CronTaskManager

java.lang.Object
  extended by com.jivesoftware.util.CronTaskManager
All Implemented Interfaces:
JiveManager

public class CronTaskManager
extends java.lang.Object
implements JiveManager

Manages the creation and persistence of CronTasks. Multiple CronTaskManagers can be created each with an individual config file.

See Also:
CronTask, CronTimer

Method Summary
protected  void addCronTask(CronTask cronTask)
          Method which is used to add cron tasks to the manager without cluster propogation.
 CronTask createCronTask(java.lang.Runnable task, CronTimer timer)
          Create a new CronTask.
 void deleteCronTask(CronTask task)
          Persist the CronTask configuration.
 void destroy()
          Notifies the manager to release any resources that may be holding on too.
 int getCronTaskCount()
          Returns the number of currently configured CronTasks.
 java.util.Iterator getCronTasks()
          Returns a list of all the currently configured CronTasks.
static CronTaskManager getInstance()
           
 void initialize()
          Initialize the manager.
 void removeCronTask(CronTask cronTask)
          Stop the cronTask and remove the cronTask from the current list of CronTasks.
protected  void removeCronTaskNoCluster(CronTask cronTask)
          Method which is used to stop and remove cron tasks without cluster propogation.
 void saveCronTask(CronTask task)
          Persist the CronTask configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CronTaskManager getInstance()

initialize

public void initialize()
Description copied from interface: JiveManager
Initialize the manager. It is within this method that it is ok to create, access and/or otherwise use external classes (including caches). Until this method is called implementation should not access any external classes that could possibly either access one of the main Factory classes or any caches since doing so can cause deadlocks and possible clustering issues during startup.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
initialize in interface JiveManager

destroy

public void destroy()
Description copied from interface: JiveManager
Notifies the manager to release any resources that may be holding on too. This could also be used to clear out the managers caches, etc.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
destroy in interface JiveManager

createCronTask

public CronTask createCronTask(java.lang.Runnable task,
                               CronTimer timer)
Create a new CronTask. The CronTask that is created is started immediately meaning that there is no need to add the CronTask to the TaskEngine once it's been created.

This class is only useful for tasks which should be persisted across app-server restarts. Tasks that should be run immediately or just a single time in the near future should use the TaskEngine.addTask(Runnable) method instead of this class.

Parameters:
task - the task to schedule.
timer - the CronTimer to use for scheduling the task
Returns:
a CronTask instance

addCronTask

protected void addCronTask(CronTask cronTask)
Method which is used to add cron tasks to the manager without cluster propogation. This method is only intended to be used internally to Jive by the CronClusterUpdateTask class.

Parameters:
cronTask - the cron task to add

removeCronTask

public void removeCronTask(CronTask cronTask)
Stop the cronTask and remove the cronTask from the current list of CronTasks.

Parameters:
cronTask - the CronTask to remove

removeCronTaskNoCluster

protected void removeCronTaskNoCluster(CronTask cronTask)
Method which is used to stop and remove cron tasks without cluster propogation. This method is only intended to be used internally to Jive by the CronClusterUpdateTask class.

Parameters:
cronTask - the CronTask to remove

getCronTaskCount

public int getCronTaskCount()
Returns the number of currently configured CronTasks.

Returns:
the number of currently configured CronTasks

getCronTasks

public java.util.Iterator getCronTasks()
Returns a list of all the currently configured CronTasks.

Returns:
a list of all the currently configured CronTasks

saveCronTask

public void saveCronTask(CronTask task)
Persist the CronTask configuration. This method should only be called after modifying an individual cronTask that is being managed by this CronTaskManager.


deleteCronTask

public void deleteCronTask(CronTask task)
Persist the CronTask configuration. This method should only be called after modifying an individual cronTask that is being managed by this CronTaskManager.


Jive Forums Project Page

Copyright © 1999-2006 Jive Software.