public interface RunnableBuilder
runnables. Those are
useful for implementing trigger strategies. For simple strategy
implementations it might be useful to only use
createRunnableStack(InjectedMethodInvocation, ScheduledContext, ExceptionHandler)
for obtaining a runnable that can be scheduled some how.| Modifier and Type | Method and Description |
|---|---|
LockableRunnable |
createLockedRunnableStack(InjectedMethodInvocation invocation,
ScheduledContext context,
ExceptionHandler handler)
Like
createRunnableStack(InjectedMethodInvocation, ScheduledContext, ExceptionHandler)
but creates a Runnable which must be released before it is able to be executed. |
Runnable |
createRunnableStack(InjectedMethodInvocation invocation,
ScheduledContext context,
ExceptionHandler handler)
Creates a
Runnable for running an execution in the scope of a given
context and to handle errors with the given
ExceptionHandler. |
Runnable |
handleException(Runnable wrapped,
ExceptionHandler handler)
Creates a
Runnable that wraps around the given one and which delegates
excptions thrown by the inner runnable to the given handler. |
Runnable |
invoke(InjectedMethodInvocation invocation)
Creates a
Runnable which will execute the given invocation. |
Reschedulable |
reschedule(ScheduledContext context,
Runnable wrapped,
ScheduledExecutorService scheduler,
com.cronutils.model.time.ExecutionTime executionTime)
Creates a runnable that reschedules itself with the provided scheduler before
actually executing the given invocation.
|
Runnable |
scope(Runnable unscoped,
ScheduledContext context)
Creates a runnable which wraps around another runnable and executes the wrapped
instance in the scope of the given
ExecutionContext. |
Runnable createRunnableStack(InjectedMethodInvocation invocation, ScheduledContext context, ExceptionHandler handler)
Runnable for running an execution in the scope of a given
context and to handle errors with the given
ExceptionHandler. The result is a stacked Runnable made up of
runnables created from the methods from this builder.invocation - The invocation to execute.context - The context of the execution.handler - The error handler.LockableRunnable createLockedRunnableStack(InjectedMethodInvocation invocation, ScheduledContext context, ExceptionHandler handler)
createRunnableStack(InjectedMethodInvocation, ScheduledContext, ExceptionHandler)
but creates a Runnable which must be released before it is able to be executed.invocation - The invocation to execute.context - The context of the execution.handler - The error handler.Runnable scope(Runnable unscoped, ScheduledContext context)
ExecutionContext. That is,
ScheduledContext.beginNewExecution() is called before- and
ScheduledContext.finishExecution() is called after the execution.unscoped - The unscoped runnable.context - The context in which the unscoped runnable will be executed.Runnable invoke(InjectedMethodInvocation invocation)
Runnable which will execute the given invocation.invocation - The invocation.Runnable handleException(Runnable wrapped, ExceptionHandler handler)
Runnable that wraps around the given one and which delegates
excptions thrown by the inner runnable to the given handler.wrapped - The wrapped runnable.handler - The exception handler.Reschedulable reschedule(ScheduledContext context, Runnable wrapped, ScheduledExecutorService scheduler, com.cronutils.model.time.ExecutionTime executionTime)
context - The context.wrapped - The actual invocation.scheduler - The scheduler for rescheduling.executionTime - For figuring out the delay until the next execution.Copyright © 2014–2018. All rights reserved.