Search in sources :

Example 6 with TimeSource

use of com.haulmont.cuba.core.global.TimeSource in project cuba by cuba-platform.

the class TaskHandlerImpl method execute.

@Override
public final void execute() {
    checkState(!started, "Task is already started. Task: " + taskExecutor.getTask().toString());
    this.started = true;
    TimeSource timeSource = AppBeans.get(TimeSource.NAME);
    this.startTimeStamp = timeSource.currentTimestamp().getTime();
    this.watchDog.manageTask(this);
    log.trace("Run task: {}. User: {}", taskExecutor.getTask(), getUserSession().getId());
    taskExecutor.startExecution();
}
Also used : TimeSource(com.haulmont.cuba.core.global.TimeSource)

Aggregations

TimeSource (com.haulmont.cuba.core.global.TimeSource)6 Date (java.util.Date)2 ScheduledTask (com.haulmont.cuba.core.entity.ScheduledTask)1 UserSessionSource (com.haulmont.cuba.core.global.UserSessionSource)1 UserSessionService (com.haulmont.cuba.security.app.UserSessionService)1 UserSessionEntity (com.haulmont.cuba.security.entity.UserSessionEntity)1 Calendar (java.util.Calendar)1 Future (javax.validation.constraints.Future)1 Test (org.junit.Test)1