Package me.ehp246.aufjms.core.dispatch
Class DispatchLogger
java.lang.Object
me.ehp246.aufjms.core.dispatch.DispatchLogger
- All Implemented Interfaces:
DispatchListener,DispatchListener.OnDispatch,DispatchListener.OnException,DispatchListener.PostSend,DispatchListener.PreSend
public final class DispatchLogger
extends Object
implements DispatchListener.OnDispatch, DispatchListener.PreSend, DispatchListener.PostSend, DispatchListener.OnException
- Since:
- 1.0
- Author:
- Lei Yang
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.ehp246.aufjms.api.dispatch.DispatchListener
DispatchListener.OnDispatch, DispatchListener.OnException, DispatchListener.PostSend, DispatchListener.PreSend -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonDispatch(JmsDispatch dispatch) Invoked immediately after JmsDispatchFn.send(JmsDispatch) is called and before any JMS API invocations to construct and send the message.voidonException(JmsDispatch dispatch, JmsMsg msg, Exception e) Invoked when an Exception has happened and before it is thrown to the caller interrupting JmsDispatchFn.send(JmsDispatch).voidpostSend(JmsDispatch dispatch, JmsMsg msg) Invoked after the TextMessage has been sent and before JmsDispatchFn.send(JmsDispatch) returns successfully.voidpreSend(JmsDispatch dispatch, JmsMsg msg) Invoked after a TextMessage has been successfully constructed for the JmsDispatch and just before the message is sent.
-
Constructor Details
-
DispatchLogger
public DispatchLogger()
-
-
Method Details
-
onDispatch
Description copied from interface:DispatchListener.OnDispatchInvoked immediately after JmsDispatchFn.send(JmsDispatch) is called and before any JMS API invocations to construct and send the message.This is the first event on the listener. It is very unlikely to be interrupted by an exception unless
dispatchisnull.- Specified by:
onDispatchin interfaceDispatchListener.OnDispatch
-
preSend
Description copied from interface:DispatchListener.PreSendInvoked after a TextMessage has been successfully constructed for the JmsDispatch and just before the message is sent.This event will not trigger if an exception interrupts the construction operations.
- Specified by:
preSendin interfaceDispatchListener.PreSend
-
postSend
Description copied from interface:DispatchListener.PostSendInvoked after the TextMessage has been sent and before JmsDispatchFn.send(JmsDispatch) returns successfully.Exception thrown from a listener will be suppressed. All listeners will be invoked.
- Specified by:
postSendin interfaceDispatchListener.PostSend
-
onException
Description copied from interface:DispatchListener.OnExceptionInvoked when an Exception has happened and before it is thrown to the caller interrupting JmsDispatchFn.send(JmsDispatch).msgmight benulldepending on the cause.Exception thrown from a listener will be suppressed. All listeners will be invoked.
- Specified by:
onExceptionin interfaceDispatchListener.OnException
-