Package org.apache.synapse.task
Class TaskScheduler
java.lang.Object
org.apache.synapse.task.TaskScheduler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteTask(String name, String group) intvoidinit(Properties properties, TaskManager taskManager) booleanbooleanisTaskAlreadyRunning(Object taskKey) booleanisTaskDeactivated(String name) Checks if a task with the specified name is deactivated.booleanvoidpauseAll()booleanPauses a specified task.voidbooleanresumeTask(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 Details
-
TaskScheduler
-
-
Method Details
-
init
-
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
-
scheduleTask
-
shutDown
public void shutDown() -
isInitialized
public boolean isInitialized() -
isTaskSchedulerInitialized
public boolean isTaskSchedulerInitialized() -
deleteTask
-
resumeTask
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
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
-
isTaskDeactivated
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
-
setJobDetailFactory
-