Package org.apache.synapse.task
Interface TaskManager
-
public interface TaskManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addObserver(TaskManagerObserver o)
Adds a new Observer to the list of observers of this task manager.boolean
delete(String name)
Properties
getConfigurationProperties()
String
getName()
Object
getProperty(String name)
String
getProviderClass()
int
getRunningTaskCount()
TaskDescription
getTask(String name)
String[]
getTaskNames()
boolean
init(Properties properties)
boolean
isInitialized()
boolean
isTaskBlocked(String taskName)
Checks whether theTask
with the given name is blocked without giving the control back to the schedular.boolean
isTaskDeactivated(String taskName)
Checks whether theTask
with the given name is deactivated.boolean
isTaskExist(String taskName)
Checks whether theTask
with the given name exists.boolean
isTaskRunning(Object taskKey)
boolean
isTaskRunning(String taskName)
Checks whether theTask
with the given name is running.boolean
pause(String name)
boolean
pauseAll()
boolean
reschedule(String name, TaskDescription taskDescription)
boolean
resume(String name)
boolean
resumeAll()
boolean
schedule(TaskDescription taskDescription)
Schedules a task on an external task scheduler based on the parameters of the TaskDescription.void
sendClusterMessage(Callable<Void> task)
Sends a cluster message, with the givenCallable
task in this cluster.void
setConfigurationProperties(Properties properties)
void
setName(String name)
boolean
setProperties(Map<String,Object> properties)
boolean
setProperty(String name, Object property)
boolean
start()
boolean
stop()
-
-
-
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 theTask
with the given name is deactivated.- Parameters:
taskName
- name of the Task- Returns:
true
if the task is deactivated,false
otherwise
-
isTaskBlocked
boolean isTaskBlocked(String taskName)
Checks whether theTask
with the given name is blocked without giving the control back to the schedular.- Parameters:
taskName
- name of the Task- Returns:
true
if the task is blocked,false
otherwise.
-
isTaskRunning
boolean isTaskRunning(String taskName)
Checks whether theTask
with the given name is running.- Parameters:
taskName
- name of the Task- Returns:
true
if the task is running,false
otherwise.
-
sendClusterMessage
void sendClusterMessage(Callable<Void> task)
Sends a cluster message, with the givenCallable
task in this cluster. The givenCallable
task is executed by all the nodes in the cluster- Parameters:
task
-Callable
task to be executed by members in the cluster.
-
-