Package org.apache.synapse.task
Interface TaskManager
-
public interface TaskManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddObserver(TaskManagerObserver o)Adds a new Observer to the list of observers of this task manager.booleandelete(String name)PropertiesgetConfigurationProperties()StringgetName()ObjectgetProperty(String name)StringgetProviderClass()intgetRunningTaskCount()TaskDescriptiongetTask(String name)String[]getTaskNames()booleaninit(Properties properties)booleanisInitialized()booleanisTaskBlocked(String taskName)Checks whether theTaskwith the given name is blocked without giving the control back to the schedular.booleanisTaskDeactivated(String taskName)Checks whether theTaskwith the given name is deactivated.booleanisTaskExist(String taskName)Checks whether theTaskwith the given name exists.booleanisTaskRunning(Object taskKey)booleanisTaskRunning(String taskName)Checks whether theTaskwith the given name is running.booleanpause(String name)booleanpauseAll()booleanreschedule(String name, TaskDescription taskDescription)booleanresume(String name)booleanresumeAll()booleanschedule(TaskDescription taskDescription)Schedules a task on an external task scheduler based on the parameters of the TaskDescription.voidsendClusterMessage(Callable<Void> task)Sends a cluster message, with the givenCallabletask in this cluster.voidsetConfigurationProperties(Properties properties)voidsetName(String name)booleansetProperties(Map<String,Object> properties)booleansetProperty(String name, Object property)booleanstart()booleanstop()
-
-
-
Method Detail
-
schedule
boolean schedule(TaskDescription taskDescription)
Schedules a task on an external task scheduler based on the parameters of the TaskDescription.- Parameters:
taskDescription- Contains parameters for the task scheduler. eg. target type, url, trigger parameters etc.- Returns:
- true if the scheduling is successful, false otherwise.
-
reschedule
boolean reschedule(String name, TaskDescription taskDescription)
-
delete
boolean delete(String name)
-
pause
boolean pause(String name)
-
pauseAll
boolean pauseAll()
-
resume
boolean resume(String name)
-
resumeAll
boolean resumeAll()
-
getTask
TaskDescription getTask(String name)
-
getTaskNames
String[] getTaskNames()
-
init
boolean init(Properties properties)
-
isInitialized
boolean isInitialized()
-
start
boolean start()
-
stop
boolean stop()
-
getRunningTaskCount
int getRunningTaskCount()
-
isTaskRunning
boolean isTaskRunning(Object taskKey)
-
setName
void setName(String name)
-
getName
String getName()
-
getProviderClass
String getProviderClass()
-
getConfigurationProperties
Properties getConfigurationProperties()
-
setConfigurationProperties
void setConfigurationProperties(Properties properties)
-
addObserver
void addObserver(TaskManagerObserver o)
Adds a new Observer to the list of observers of this task manager.- Parameters:
o- New Observer to be registered or subscribed.
-
isTaskDeactivated
boolean isTaskDeactivated(String taskName)
Checks whether theTaskwith the given name is deactivated.- Parameters:
taskName- name of the Task- Returns:
trueif the task is deactivated,falseotherwise
-
isTaskBlocked
boolean isTaskBlocked(String taskName)
Checks whether theTaskwith the given name is blocked without giving the control back to the schedular.- Parameters:
taskName- name of the Task- Returns:
trueif the task is blocked,falseotherwise.
-
isTaskRunning
boolean isTaskRunning(String taskName)
Checks whether theTaskwith the given name is running.- Parameters:
taskName- name of the Task- Returns:
trueif the task is running,falseotherwise.
-
sendClusterMessage
void sendClusterMessage(Callable<Void> task)
Sends a cluster message, with the givenCallabletask in this cluster. The givenCallabletask is executed by all the nodes in the cluster- Parameters:
task-Callabletask to be executed by members in the cluster.
-
-