public class SimpleDeadlineManager extends AbstractDeadlineManager implements Lifecycle
DeadlineManagerwhich uses Java's
ScheduledExecutorServiceas scheduling and triggering mechanism.
Note that this mechanism is non-persistent. Scheduled tasks will be lost then the JVM is shut down, unless special
measures have been taken to prevent that. For more flexible and powerful scheduling options, see
|Modifier and Type||Class and Description|
Builder class to instantiate a
|Modifier||Constructor and Description|
|Modifier and Type||Method and Description|
Instantiate a Builder to be able to create a
Cancels all the deadlines corresponding to the given
Cancels all deadlines corresponding to the given
Cancels the deadline corresponding to the given
Registers the activities to be executed in the various phases of an application's lifecycle.
Schedules a deadline at given
Shuts down this deadline manager.
dispatchInterceptors, handlerInterceptors, processDispatchInterceptors, registerDispatchInterceptor, registerHandlerInterceptor, runOnPrepareCommitOrNow
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected SimpleDeadlineManager(SimpleDeadlineManager.Builder builder)
SimpleDeadlineManagerbased on the fields contained in the
SimpleDeadlineManager.Builderto handle the process around scheduling and triggering a
public static SimpleDeadlineManager.Builder builder()
ScheduledExecutorService is defaulted to an
which contains an
TransactionManager defaults to a
NoTransactionManager, and the
SpanFactory is defaulted to a
ScopeAwareProvider is a hard requirement and as such should be provided.
public String schedule(@Nonnull Instant triggerDateTime, @Nonnull String deadlineName, Object messageOrPayload, @Nonnull ScopeDescriptor deadlineScope)
triggerDateTimewith provided context. The returned
deadlineNamecombination can be used to cancel the scheduled deadline.
messageOrPayload may be any object, as well as a DeadlineMessage. In the latter case, the
instance provided is the donor for the payload and
MetaData of the actual
deadline being used. In the former case, the given
messageOrPayload will be wrapped as the payload of a
Instantdenoting the moment to trigger the deadline handling
Stringrepresenting the name of the deadline to schedule
Messageor payload for a message as an
ScopeDescriptordescribing the scope within which the deadline was scheduled
Stringto use when cancelling the schedule
scheduleIdcombination. This method has no impact on deadlines which have already been triggered.
deadlineName. This method has no impact on deadlines which have already been triggered.
public void cancelAllWithinScope(@Nonnull String deadlineName, @Nonnull ScopeDescriptor scope)
scope. This method has no impact on deadlines which have already been triggered.
public void registerLifecycleHandlers(@Nonnull Lifecycle.LifecycleRegistry lifecycle)
lifecycle- the lifecycle instance to register the handlers with
Copyright © 2010–2022. All rights reserved.