org.mule.transport.polling
Class MessageProcessorPollingInterceptor

java.lang.Object
  extended by org.mule.transport.polling.MessageProcessorPollingInterceptor
Direct Known Subclasses:
WatermarkPollingInterceptor

public abstract class MessageProcessorPollingInterceptor
extends Object

Extension point for overriding MessageProcessorPolling functionality. This allows to hook on the creation of the event that gets processed as part of the message source evaluation. Users are expected to return instances of this class (or more likely subclasses) when requested via the MessageProcessorPollingOverride methods.


Constructor Summary
MessageProcessorPollingInterceptor()
           
 
Method Summary
 void postProcessRouting(MuleEvent event)
          Post process the event after it was routed to the rest of the flow.
 MuleEvent prepareRouting(MuleEvent sourceEvent, MuleEvent event)
          Called after the polling message processor processes the event, but before an event is routed to the rest of the flow.
 MuleEvent prepareSourceEvent(MuleEvent event)
          Called before sending the event to the message processor that will do poll for events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageProcessorPollingInterceptor

public MessageProcessorPollingInterceptor()
Method Detail

prepareSourceEvent

public MuleEvent prepareSourceEvent(MuleEvent event)
                             throws MuleException
Called before sending the event to the message processor that will do poll for events. By default, a new event is created with a message containing an empty string payload. This method may enrich the event or message before it is sent to the processor, or event replace the event).

Parameters:
event - The event that is about to be sent
Returns:
The event that should be sent. Must not be null
Throws:
MuleException

prepareRouting

public MuleEvent prepareRouting(MuleEvent sourceEvent,
                                MuleEvent event)
                         throws MuleException
Called after the polling message processor processes the event, but before an event is routed to the rest of the flow. As poll creates an independent event if the polling message processor returns a message, any auxiliary information is discarded. This extension point allows to carry over (or just add) properties to the event that will be sent to the rest of the flow. Note that the source event is discarded after this point, so it doesn't make sense to modify it.

Parameters:
sourceEvent - The event that was returned by the polling processor
event - The event that is about to be sent to the rest of the flow
Returns:
The event that should be sent to the rest of the flow. Must not be null
Throws:
MuleException

postProcessRouting

public void postProcessRouting(MuleEvent event)
                        throws MuleException
Post process the event after it was routed to the rest of the flow. When this method is called depends on the flow processing strategy. Synchronous processing will make this being called after the flow is executed. Asynchronous processing will make this be called after handing the event to listeners.

Implementations should consider the event to be immutable

Parameters:
event - The event that was routed to the rest of the flow
Throws:
MuleException


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.