Class BoxScheduler
java.lang.Object
ortus.boxlang.runtime.async.tasks.BaseScheduler
ortus.boxlang.runtime.async.tasks.BoxScheduler
- All Implemented Interfaces:
IScheduler
This class acts as a wrapper around the target BoxLang scheduler.
It implements the
IScheduler interface and provides
the life-cycle callbacks that are required by the BoxLang
scheduler system.-
Field Summary
Fields inherited from class ortus.boxlang.runtime.async.tasks.BaseScheduler
asyncService, context, executor, logger, name, started, startedAt, tasks, timezone -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterAnyTask(ScheduledTask task, Optional<?> result) Called after ANY task runsvoidbeforeAnyTask(ScheduledTask task) Called before ANY task runsvoidConfigure the schedulervoidonAnyTaskError(ScheduledTask task, Exception exception) Called whenever ANY task failsvoidonAnyTaskSuccess(ScheduledTask task, Optional<?> result) Called whenever ANY task succeedsvoidCalled before the scheduler is going to be shutdownvoidCalled after the scheduler has registered all schedulesMethods inherited from class ortus.boxlang.runtime.async.tasks.BaseScheduler
clearTasks, getAsyncService, getContext, getExecutor, getLogger, getRegisteredTasks, getSchedulerName, getStartedAt, getTaskRecord, getTasks, getTaskStats, getTimezone, hasStarted, hasTask, isRunning, removeTask, restart, setContext, setDefaultTimezone, setExecutor, setSchedulerName, setTimezone, setTimezone, shutdown, shutdown, shutdown, startup, startupTask, startupTask, task, task, xtask, xtaskMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ortus.boxlang.runtime.async.tasks.IScheduler
getSchedulerNameAsKey
-
Constructor Details
-
BoxScheduler
Constructor- Parameters:
target- The target scheduler
-
-
Method Details
-
configure
public void configure()Configure the scheduler- Specified by:
configurein interfaceIScheduler- Overrides:
configurein classBaseScheduler
-
onShutdown
public void onShutdown()Called before the scheduler is going to be shutdown- Specified by:
onShutdownin interfaceIScheduler- Overrides:
onShutdownin classBaseScheduler
-
onStartup
public void onStartup()Called after the scheduler has registered all schedules- Specified by:
onStartupin interfaceIScheduler- Overrides:
onStartupin classBaseScheduler
-
onAnyTaskError
Called whenever ANY task fails- Specified by:
onAnyTaskErrorin interfaceIScheduler- Overrides:
onAnyTaskErrorin classBaseScheduler- Parameters:
task- The task that got executedexception- The exception object
-
onAnyTaskSuccess
Called whenever ANY task succeeds- Specified by:
onAnyTaskSuccessin interfaceIScheduler- Overrides:
onAnyTaskSuccessin classBaseScheduler- Parameters:
task- The task that got executedresult- The result (if any) that the task produced
-
beforeAnyTask
Called before ANY task runs- Specified by:
beforeAnyTaskin interfaceIScheduler- Overrides:
beforeAnyTaskin classBaseScheduler- Parameters:
task- The task about to be executed
-
afterAnyTask
Called after ANY task runs- Specified by:
afterAnyTaskin interfaceIScheduler- Overrides:
afterAnyTaskin classBaseScheduler- Parameters:
task- The task that got executedresult- The result (if any) that the task produced
-