@Component(value="cuba_SchedulingRunner") public class RunnerBean extends java.lang.Object implements Runner
Runner
interface used by Scheduling
to run scheduled tasks.Modifier and Type | Field and Description |
---|---|
protected AuthenticationManager |
authenticationManager |
protected Configuration |
configuration |
protected java.util.concurrent.ExecutorService |
executorService |
protected Metadata |
metadata |
protected Persistence |
persistence |
protected SchedulingAPI |
scheduling |
protected Scripting |
scripting |
protected ServerInfoAPI |
serverInfo |
protected MiddlewareStatisticsAccumulator |
statisticsCounter |
protected TimeSource |
timeSource |
protected java.util.Map<java.lang.String,java.util.UUID> |
userSessionIds |
protected UserSessionsAPI |
userSessions |
Constructor and Description |
---|
RunnerBean() |
Modifier and Type | Method and Description |
---|---|
protected void |
applicationStopped() |
protected java.lang.Object |
executeTask(ScheduledTask task) |
void |
init() |
protected void |
registerExecutionFinish(ScheduledTask task,
ScheduledExecution execution,
java.lang.Object result,
boolean manually) |
protected ScheduledExecution |
registerExecutionStart(ScheduledTask task,
long now) |
protected void |
runTask(ScheduledTask task,
long now,
boolean manually,
UserSession userSession) |
void |
runTask(ScheduledTask task,
long now,
UserSession userSession) |
void |
runTaskOnce(ScheduledTask task,
long now,
UserSession userSession)
Runs a task right now and only once.
|
protected void |
setSecurityContext(ScheduledTask task,
UserSession userSession) |
protected java.util.concurrent.ExecutorService executorService
@Inject protected SchedulingAPI scheduling
@Inject protected ServerInfoAPI serverInfo
@Inject protected Persistence persistence
@Inject protected TimeSource timeSource
@Inject protected AuthenticationManager authenticationManager
@Inject protected UserSessionsAPI userSessions
@Inject protected Scripting scripting
@Inject protected MiddlewareStatisticsAccumulator statisticsCounter
@Inject protected Metadata metadata
@Inject protected Configuration configuration
protected java.util.Map<java.lang.String,java.util.UUID> userSessionIds
@PostConstruct public void init()
public void runTask(ScheduledTask task, long now, @Nullable UserSession userSession)
public void runTaskOnce(ScheduledTask task, long now, @Nullable UserSession userSession)
Runner
runTaskOnce
in interface Runner
task
- task to executenow
- current time in millisecondsuserSession
- user session@EventListener(value=AppContextStoppedEvent.class) protected void applicationStopped()
protected void runTask(ScheduledTask task, long now, boolean manually, @Nullable UserSession userSession)
protected void setSecurityContext(ScheduledTask task, @Nullable UserSession userSession) throws LoginException
LoginException
protected ScheduledExecution registerExecutionStart(ScheduledTask task, long now)
protected void registerExecutionFinish(ScheduledTask task, ScheduledExecution execution, java.lang.Object result, boolean manually)
protected java.lang.Object executeTask(ScheduledTask task)