public abstract class AbstractTask extends Object implements 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 |
stop()
Stop the task.
|
protected String id
public void addService(ServiceWithParameters service)
addService
in interface Task
service
- Service which needs to be attached to the task.public void removeService(String serviceName)
removeService
in interface Task
serviceName
- Name of the service which needs to be detached from the task.public HashMap<String,ServiceWithParameters> getServicesMap()
getServicesMap
in interface Task
public ServiceWithParameters getService(String serviceName)
getService
in interface Task
serviceName
- Service name of which the service should be retrieved.public String getId()
public void stop() throws SchedulingException
stop
in interface Task
SchedulingException
- If the task cannot be stopped.public void pause() throws SchedulingException
pause
in interface Task
SchedulingException
- If the task cannot be paused.public void resume() throws SchedulingException
resume
in interface Task
SchedulingException
- If the task cannot be resumed.Copyright © 2019 WSO2. All rights reserved.