@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()
SchedulingServicegetAvailableBeans in interface SchedulingServicepublic void setActive(boolean active)
SchedulingServiceThis 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 SchedulingServiceactive - true to activate schedulingpublic void setActive(ScheduledTask task, boolean active)
SchedulingServicesetActive in interface SchedulingServicetask - task instanceactive - true to activatepublic void setActive(java.util.Set<ScheduledTask> tasks, boolean active)
SchedulingServicesetActive in interface SchedulingServicetasks - task instancesactive - true to activatepublic void runOnce(ScheduledTask task)
SchedulingServicerunOnce in interface SchedulingServicetask - task to executepublic java.util.List<ScheduledTask> getRunningTasks()
getRunningTasks in interface SchedulingService