org.mule.transport.polling.watermark.selector
Class SelectorWatermark

java.lang.Object
  extended by org.mule.transport.polling.MessageProcessorPollingOverride
      extended by org.mule.transport.polling.watermark.Watermark
          extended by org.mule.transport.polling.watermark.selector.SelectorWatermark
All Implemented Interfaces:
MuleContextAware, Initialisable

public class SelectorWatermark
extends Watermark
implements Initialisable, MuleContextAware

Implementation of Watermark that relies on a WatermarkSelector to update its values

Since:
3.5.0

Field Summary
 
Fields inherited from class org.mule.transport.polling.watermark.Watermark
annotations
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Constructor Summary
SelectorWatermark(ObjectStore<Serializable> objectStore, String variable, String defaultExpression, WatermarkSelectorBroker selectorBroker, String selectorExpression)
           
 
Method Summary
protected  Object getUpdatedValue(MuleEvent event)
          Returns the selectorBroker value and resets it so that its reusable.
 void initialise()
          Method used to perform any initialisation work.
 MessageProcessorPollingInterceptor interceptor()
          Returns an interceptor instance.
 void setMuleContext(MuleContext muleContext)
           
 
Methods inherited from class org.mule.transport.polling.watermark.Watermark
putInto, resolveVariable, updateFrom, updateWith
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectorWatermark

public SelectorWatermark(ObjectStore<Serializable> objectStore,
                         String variable,
                         String defaultExpression,
                         WatermarkSelectorBroker selectorBroker,
                         String selectorExpression)
Method Detail

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

getUpdatedValue

protected Object getUpdatedValue(MuleEvent event)
Returns the selectorBroker value and resets it so that its reusable. Notice that the selectorBroker is reusable without risk of concurrency issues because watermark only works on synchronous flows

Specified by:
getUpdatedValue in class Watermark
Parameters:
event - the MuleEvent that was returned by the owning flow
Returns:
the new watermark value

interceptor

public MessageProcessorPollingInterceptor interceptor()
Returns an interceptor instance. This method will be called on every poll, and may return a new instance every time or always the same instance (the latter case requires the instance to be threadsafe). Interceptor's are scoped for each poll and flow execution and will be discarded after the scope ends.

Specified by:
interceptor in class MessageProcessorPollingOverride
Returns:
a new SelectorWatermarkPollingInterceptor

setMuleContext

public void setMuleContext(MuleContext muleContext)
Specified by:
setMuleContext in interface MuleContextAware


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