public interface Task
Modifier and Type | Method and Description |
---|---|
void |
addService(ServiceWithParameters service)
Add particular service to the registry of the Task.
|
String |
getId()
Get the registered ID of the task.
|
ServiceWithParameters |
getService(String serviceName)
Get map of attached services of the task.
|
HashMap<String,ServiceWithParameters> |
getServicesMap()
Get map of attached services of the task.
|
void |
pause()
Pause the task.
|
void |
removeService(String serviceName)
Remove particular service from the registry of the Task.
|
void |
resume()
Resumes the task.
|
void |
start(Context context)
Run all the services attached to the task.
|
void |
stop()
Stop the task.
|
String getId()
void start(Context context) throws SchedulingException
context
- Ballerina context which runs the services.SchedulingException
- When there is a failure to stop the task after maximum number of runs specified.void stop() throws SchedulingException
SchedulingException
- If the task cannot be stopped.void pause() throws SchedulingException
SchedulingException
- If the task cannot be paused.void resume() throws SchedulingException
SchedulingException
- If the task cannot be resumed.HashMap<String,ServiceWithParameters> getServicesMap()
ServiceWithParameters getService(String serviceName)
serviceName
- Service name of which the service should be retrieved.void addService(ServiceWithParameters service)
service
- Service which needs to be attached to the task.void removeService(String serviceName)
serviceName
- Name of the service which needs to be detached from the task.Copyright © 2019 WSO2. All rights reserved.