org.mule.transport.polling.watermark
Class UpdateExpressionWatermark

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.UpdateExpressionWatermark
All Implemented Interfaces:
MuleContextAware, Initialisable

public class UpdateExpressionWatermark
extends Watermark
implements Initialisable, MuleContextAware

Implementation of Watermark in which the value is updated through a MEL expression


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
UpdateExpressionWatermark(ObjectStore<Serializable> objectStore, String variable, String defaultExpression, String updateExpression)
           
 
Method Summary
protected  Object getUpdatedValue(MuleEvent event)
          Returns the new watermark value by evaluating updateExpression on the flowVar of the given name
 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

UpdateExpressionWatermark

public UpdateExpressionWatermark(ObjectStore<Serializable> objectStore,
                                 String variable,
                                 String defaultExpression,
                                 String updateExpression)
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 new watermark value by evaluating updateExpression on the flowVar of the given name

Specified by:
getUpdatedValue in class Watermark
Parameters:
event - the @{link MuleEvent in which the watermark is being evaluated
Returns:
a Serializable value

interceptor

public MessageProcessorPollingInterceptor interceptor()
Description copied from class: MessageProcessorPollingOverride
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 interceptor instance that cn be used to alter the functionality of a message processor polling component

setMuleContext

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


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