public class MultiplexingEventProcessingMonitor extends Object implements EventProcessingMonitor
Constructor and Description |
---|
MultiplexingEventProcessingMonitor(EventProcessingMonitor targetMonitor)
Creates an instance with the given
targetMonitor as the monitor to eventually forward calls to. |
Modifier and Type | Method and Description |
---|---|
void |
onEventProcessingCompleted(List<? extends EventMessage> eventMessages)
Invoked when one or more events have been successfully processed by the instance it was subscribed to.
|
void |
onEventProcessingFailed(List<? extends EventMessage> eventMessages,
Throwable cause)
Invoked when one or more events have failed processing by the instance it was subscribed to.
|
void |
prepare(EventMessage eventMessage)
Prepare the monitor for processing the given
message . |
void |
prepareForInvocation(EventMessage eventMessage,
EventListener member)
Prepare the monitor for the invocation of the given
message to the given member . |
public MultiplexingEventProcessingMonitor(EventProcessingMonitor targetMonitor)
targetMonitor
as the monitor to eventually forward calls to.targetMonitor
- The monitor to eventually forward calls topublic void prepare(EventMessage eventMessage)
message
. This means a tracker will be created to this
event, which keeps track of the required and actual invocations.
When an unprepared message is acknowledged or reported as failed, that notification is immediately forwarded to
the target monitor.eventMessage
- The event message to prepare for.public void prepareForInvocation(EventMessage eventMessage, EventListener member)
message
to the given member
. This
means that, if the given member implement EventProcessingMonitorSupport
,
the monitor will wait for an invocation by that member's monitor.
It is important that this invocation happens before the actual invocation of the member.eventMessage
- The message about to be sentmember
- The member that will be invokedIllegalArgumentException
- if the given eventMessage
has not been prepared
yet.public void onEventProcessingCompleted(List<? extends EventMessage> eventMessages)
EventProcessingMonitor
onEventProcessingCompleted
in interface EventProcessingMonitor
eventMessages
- The messages that have been successfully processedpublic void onEventProcessingFailed(List<? extends EventMessage> eventMessages, Throwable cause)
EventProcessingMonitor
onEventProcessingFailed
in interface EventProcessingMonitor
eventMessages
- The message that failedcause
- The cause of the failureCopyright © 2010-2014. All Rights Reserved.