Package org.apache.synapse.task
Class TaskScheduler
- java.lang.Object
-
- org.apache.synapse.task.TaskScheduler
-
public class TaskScheduler extends Object
-
-
Constructor Summary
Constructors Constructor Description TaskScheduler(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteTask(String name, String group)intgetRunningTaskCount()voidinit(Properties properties, TaskManager taskManager)booleanisInitialized()booleanisTaskAlreadyRunning(Object taskKey)booleanisTaskDeactivated(String name)Checks if a task with the specified name is deactivated.booleanisTaskSchedulerInitialized()voidpauseAll()booleanpauseTask(String name)Pauses a specified task.voidresumeAll()booleanresumeTask(String name)Resumes a specified task.booleanscheduleTask(TaskDescription taskDescription)booleanscheduleTask(TaskDescription taskDescription, Map<String,Object> resources, Class taskClass)booleanscheduleTask(TaskDescription taskDescription, Map<String,Object> resources, Class jobClass, Task task)voidsetJobDetailFactory(Object jobDetailFactory)voidsetTriggerFactory(Object triggerFactory)voidshutDown()voidstart()
-
-
-
Constructor Detail
-
TaskScheduler
public TaskScheduler(String name)
-
-
Method Detail
-
init
public void init(Properties properties, TaskManager taskManager)
-
start
public void start()
-
pauseAll
public void pauseAll()
-
resumeAll
public void resumeAll()
-
scheduleTask
public boolean scheduleTask(TaskDescription taskDescription, Map<String,Object> resources, Class taskClass)
-
scheduleTask
public boolean scheduleTask(TaskDescription taskDescription, Map<String,Object> resources, Class jobClass, Task task)
-
scheduleTask
public boolean scheduleTask(TaskDescription taskDescription)
-
shutDown
public void shutDown()
-
isInitialized
public boolean isInitialized()
-
isTaskSchedulerInitialized
public boolean isTaskSchedulerInitialized()
-
resumeTask
public boolean resumeTask(String name)
Resumes a specified task.- Parameters:
name- The name of the task to resume.- Returns:
trueif the task was successfully resumed;falseif the task scheduler is not initialized or if the task resumption fails.
-
pauseTask
public boolean pauseTask(String name)
Pauses a specified task.- Parameters:
name- The name of the task to resume.- Returns:
trueif the task was successfully paused;falseif the task scheduler is not initialized or if the task could not be paused.
-
getRunningTaskCount
public int getRunningTaskCount()
-
isTaskAlreadyRunning
public boolean isTaskAlreadyRunning(Object taskKey)
-
isTaskDeactivated
public boolean isTaskDeactivated(String name)
Checks if a task with the specified name is deactivated.- Parameters:
name- the name of the task to check.- Returns:
trueif the task is deactivated,falseotherwise or if the scheduler is not initialized.
-
setTriggerFactory
public void setTriggerFactory(Object triggerFactory)
-
setJobDetailFactory
public void setJobDetailFactory(Object jobDetailFactory)
-
-