@Service(value="cuba_ScheduledTasksService") public class SchedulingServiceBean extends java.lang.Object implements SchedulingService
Modifier and Type | Class and Description |
---|---|
static class |
SchedulingServiceBean.SetSchedulingActiveMsg |
Modifier and Type | Field and Description |
---|---|
protected DataManager |
dataManager |
protected Persistence |
persistence |
protected SchedulingBeansMetadata |
schedulingBeansMetadata |
NAME
Constructor and Description |
---|
SchedulingServiceBean() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.util.List<MethodInfo>> |
getAvailableBeans()
Return information about beans and their methods that can be invoked by scheduled tasks.
|
java.util.List<ScheduledTask> |
getRunningTasks() |
void |
runOnce(ScheduledTask task)
Runs a task right now and only once.
|
void |
setActive(boolean active)
Activate/deactivate scheduling for all servers in the cluster.
|
void |
setActive(ScheduledTask task,
boolean active)
Activate/deactivate specific task.
|
void |
setActive(java.util.Set<ScheduledTask> tasks,
boolean active)
Activate or deactivate set of scheduled tasks.
|
@Inject protected Persistence persistence
@Inject protected SchedulingBeansMetadata schedulingBeansMetadata
@Inject protected DataManager dataManager
public java.util.Map<java.lang.String,java.util.List<MethodInfo>> getAvailableBeans()
SchedulingService
getAvailableBeans
in interface SchedulingService
public void setActive(boolean active)
SchedulingService
This method affects only the current run of each server. After server restart the
state of scheduling is defined by ServerConfig#getSchedulingActive()
configuration parameter.
setActive
in interface SchedulingService
active
- true to activate schedulingpublic void setActive(ScheduledTask task, boolean active)
SchedulingService
setActive
in interface SchedulingService
task
- task instanceactive
- true to activatepublic void setActive(java.util.Set<ScheduledTask> tasks, boolean active)
SchedulingService
setActive
in interface SchedulingService
tasks
- task instancesactive
- true to activatepublic void runOnce(ScheduledTask task)
SchedulingService
runOnce
in interface SchedulingService
task
- task to executepublic java.util.List<ScheduledTask> getRunningTasks()
getRunningTasks
in interface SchedulingService