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 void
deleteTask(String name, String group)
int
getRunningTaskCount()
void
init(Properties properties, TaskManager taskManager)
boolean
isInitialized()
boolean
isTaskAlreadyRunning(Object taskKey)
boolean
isTaskDeactivated(String name)
Checks if a task with the specified name is deactivated.boolean
isTaskSchedulerInitialized()
void
pauseAll()
boolean
pauseTask(String name)
Pauses a specified task.void
resumeAll()
boolean
resumeTask(String name)
Resumes a specified task.boolean
scheduleTask(TaskDescription taskDescription)
boolean
scheduleTask(TaskDescription taskDescription, Map<String,Object> resources, Class taskClass)
boolean
scheduleTask(TaskDescription taskDescription, Map<String,Object> resources, Class jobClass, Task task)
void
setJobDetailFactory(Object jobDetailFactory)
void
setTriggerFactory(Object triggerFactory)
void
shutDown()
void
start()
-
-
-
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:
true
if the task was successfully resumed;false
if 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:
true
if the task was successfully paused;false
if 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:
true
if the task is deactivated,false
otherwise or if the scheduler is not initialized.
-
setTriggerFactory
public void setTriggerFactory(Object triggerFactory)
-
setJobDetailFactory
public void setJobDetailFactory(Object jobDetailFactory)
-
-