Package org.axonframework.deadline
Class AbstractDeadlineManager
java.lang.Object
org.axonframework.deadline.AbstractDeadlineManager
- All Implemented Interfaces:
DeadlineManager,MessageDispatchInterceptorSupport<DeadlineMessage<?>>,MessageHandlerInterceptorSupport<DeadlineMessage<?>>
- Direct Known Subclasses:
DbSchedulerDeadlineManager,JobRunrDeadlineManager,QuartzDeadlineManager,SimpleDeadlineManager
Abstract implementation of the
DeadlineManager to be implemented by concrete solutions for the
DeadlineManager. Provides functionality to perform a call to the DeadlineManager in the a UnitOfWork it's
'prepare commit' phase. This #runOnPrepareCommitOrNow(Runnable) functionality is required, as the DeadlineManager
schedules a Message which needs to happen on order with the other messages published throughout the system.- Since:
- 3.3
- Author:
- Steven van Beelen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<MessageDispatchInterceptor<? super DeadlineMessage<?>>> Provides a list of registered dispatch interceptors.protected List<MessageHandlerInterceptor<? super DeadlineMessage<?>>> Provides a list of registered handler interceptors.protected <T> DeadlineMessage<T> processDispatchInterceptors(DeadlineMessage<T> message) Applies registeredMessageDispatchInterceptors to the givenmessage.registerDispatchInterceptor(MessageDispatchInterceptor<? super DeadlineMessage<?>> dispatchInterceptor) Register the given DispatchInterceptor.registerHandlerInterceptor(MessageHandlerInterceptor<? super DeadlineMessage<?>> handlerInterceptor) Register the givenhandlerInterceptor.protected voidrunOnPrepareCommitOrNow(Runnable deadlineCall) Run a givendeadlineCallimmediately, or schedule it for theUnitOfWorkit's 'prepare commit' phase if a UnitOfWork is active.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.deadline.DeadlineManager
cancelAll, cancelAllWithinScope, cancelAllWithinScope, cancelSchedule, schedule, schedule, schedule, schedule, schedule, schedule, shutdown
-
Constructor Details
-
AbstractDeadlineManager
public AbstractDeadlineManager()
-
-
Method Details
-
runOnPrepareCommitOrNow
Run a givendeadlineCallimmediately, or schedule it for theUnitOfWorkit's 'prepare commit' phase if a UnitOfWork is active. This is required as the DeadlineManager schedule message which we want to happen on order with other message being handled.- Parameters:
deadlineCall- aRunnableto be executed now or on prepare commit if aUnitOfWorkis active
-
registerDispatchInterceptor
public Registration registerDispatchInterceptor(@Nonnull MessageDispatchInterceptor<? super DeadlineMessage<?>> dispatchInterceptor) Description copied from interface:MessageDispatchInterceptorSupportRegister the given DispatchInterceptor. After registration, the interceptor will be invoked for each Message dispatched on the messaging component that it was registered to.- Specified by:
registerDispatchInterceptorin interfaceMessageDispatchInterceptorSupport<DeadlineMessage<?>>- Parameters:
dispatchInterceptor- The interceptor to register- Returns:
- A Registration, which may be used to deregister the interceptor.
-
registerHandlerInterceptor
public Registration registerHandlerInterceptor(@Nonnull MessageHandlerInterceptor<? super DeadlineMessage<?>> handlerInterceptor) Description copied from interface:MessageHandlerInterceptorSupportRegister the givenhandlerInterceptor. After registration, the interceptor will be invoked for each handled Message on the messaging component that it was registered to, prior to invoking the message's handler.- Specified by:
registerHandlerInterceptorin interfaceMessageHandlerInterceptorSupport<DeadlineMessage<?>>- Parameters:
handlerInterceptor- The interceptor to register- Returns:
- A Registration, which may be used to deregister the interceptor.
-
dispatchInterceptors
Provides a list of registered dispatch interceptors. Do note that this list is not modifiable, and that changes in the internal structure for dispatch interceptors will be reflected in this list.- Returns:
- a list of dispatch interceptors
-
handlerInterceptors
Provides a list of registered handler interceptors. Do note that this list is not modifiable, and that changes in the internal structure for handler interceptors will be reflected in this list.- Returns:
- a list of handler interceptors
-
processDispatchInterceptors
Applies registeredMessageDispatchInterceptors to the givenmessage.- Type Parameters:
T- the type of deadline message payload- Parameters:
message- the deadline message to be intercepted- Returns:
- intercepted message
-