public class TaskScheduler extends Object
Modifier and Type | Field and Description |
---|---|
static String |
QUARTZ_CONF
Property look up key for get a quartz configuration
|
Constructor and Description |
---|
TaskScheduler(String name) |
Modifier and Type | Method and Description |
---|---|
void |
deleteTask(String name,
String group)
Deletes a Task
|
int |
getRunningTaskCount() |
void |
init(Properties properties)
Initialize the scheduler based on provided properties
Looking for 'quartz.conf' and if found , use it for initiating quartz scheduler
|
boolean |
isInitialized() |
void |
pauseAll()
Pauses all tasks.
|
void |
resumeAll() |
void |
scheduleTask(TaskDescription taskDescription,
Map<String,Object> resources,
Class<? extends org.quartz.Job> jobClass)
Schedule a Task
|
void |
scheduleTask(TaskDescription taskDescription,
Map<String,Object> resources,
Class<? extends org.quartz.Job> jobClass,
Task task)
Schedule a Task
|
void |
setJobDetailFactory(TaskJobDetailFactory jobDetailFactory)
Sets a JobDetail Factory, if it needs to void using default factory
|
void |
setTriggerFactory(TaskTriggerFactory triggerFactory)
Sets a Trigger Factory , if it needs to void using default factory
|
void |
shutDown()
ShutDown the underlying quartz scheduler
|
void |
start()
Explicitly start up call for scheduler, return if already it has been started
|
String |
toString() |
public static final String QUARTZ_CONF
public TaskScheduler(String name)
public void init(Properties properties)
properties
- Propertiespublic void start()
public void pauseAll()
SynapseTaskException
- if an error occurs pausing all tasks.public void resumeAll()
public void scheduleTask(TaskDescription taskDescription, Map<String,Object> resources, Class<? extends org.quartz.Job> jobClass)
taskDescription
- TaskDescription , an information about Taskresources
- Any initial resources for taskjobClass
- Quartz job classpublic void scheduleTask(TaskDescription taskDescription, Map<String,Object> resources, Class<? extends org.quartz.Job> jobClass, Task task)
taskDescription
- TaskDescription , an information about Taskresources
- Any initial resources for taskjobClass
- Quartz job classtask
- The task to be executedpublic void shutDown()
public boolean isInitialized()
public void deleteTask(String name, String group)
name
- Name of the Taskgroup
- Group name of the task
Default value @see org.apache.synapse.util.task.TaskDescription.DEFAULT_GROUPpublic int getRunningTaskCount()
public void setTriggerFactory(TaskTriggerFactory triggerFactory)
triggerFactory
- TaskTriggerFactory instancepublic void setJobDetailFactory(TaskJobDetailFactory jobDetailFactory)
jobDetailFactory
- TaskJobDetailFactory instanceCopyright © 2005-2017 Apache Software Foundation. All Rights Reserved.