Search in sources :

Example 1 with Job

use of core.framework.scheduler.Job in project core-ng-project by neowu.

the class Scheduler method submitJob.

void submitJob(Trigger trigger, boolean trace) {
    jobExecutor.submit(() -> {
        try {
            ActionLog actionLog = logManager.begin("=== job execution begin ===");
            String name = trigger.name();
            actionLog.action("job:" + name);
            if (trace) {
                actionLog.trace = true;
            }
            Job job = trigger.job();
            actionLog.context("job", name);
            actionLog.context("jobClass", job.getClass().getCanonicalName());
            job.execute();
            return null;
        } catch (Throwable e) {
            logManager.logError(e);
            throw e;
        } finally {
            logManager.end("=== job execution end ===");
        }
    });
}
Also used : Job(core.framework.scheduler.Job) ActionLog(core.framework.impl.log.ActionLog)

Aggregations

ActionLog (core.framework.impl.log.ActionLog)1 Job (core.framework.scheduler.Job)1