org.mule.routing.correlation
Class EventCorrelator

java.lang.Object
  extended by org.mule.routing.correlation.EventCorrelator
All Implemented Interfaces:
Startable, Stoppable

public class EventCorrelator
extends Object
implements Startable, Stoppable


Field Summary
protected  ListableObjectStore<EventGroup> eventGroups
          A map of EventGroup objects.
protected  Object groupsLock
           
protected  long groupTimeToLive
           
protected  Log logger
          logger used by this class
static int MAX_PROCESSED_GROUPS
           
protected static long MILLI_TO_NANO_MULTIPLIER
           
static String NO_CORRELATION_ID
           
protected  ObjectStore<Long> processedGroups
           
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Constructor Summary
EventCorrelator(EventCorrelatorCallback callback, MessageProcessor timeoutMessageProcessor, MessageInfoMapping messageInfoMapping, MuleContext muleContext, String flowConstructName, boolean persistentStores, String storePrefix)
           
 
Method Summary
protected  EventGroup addEventGroup(EventGroup group)
           
protected  void addProcessedGroup(Object id)
           
 void forceGroupExpiry(String groupId)
           
protected  EventGroup getEventGroup(String groupId)
           
 long getTimeout()
           
protected  void handleGroupExpiry(EventGroup group)
           
 boolean isFailOnTimeout()
           
protected  boolean isGroupAlreadyProcessed(Object id)
           
 MuleEvent process(MuleEvent event)
           
protected  void removeEventGroup(EventGroup group)
           
 void setFailOnTimeout(boolean failOnTimeout)
           
 void setTimeout(long timeout)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final transient Log logger
logger used by this class


NO_CORRELATION_ID

public static final String NO_CORRELATION_ID
See Also:
Constant Field Values

MAX_PROCESSED_GROUPS

public static final int MAX_PROCESSED_GROUPS
See Also:
Constant Field Values

MILLI_TO_NANO_MULTIPLIER

protected static final long MILLI_TO_NANO_MULTIPLIER
See Also:
Constant Field Values

groupTimeToLive

protected long groupTimeToLive

eventGroups

protected ListableObjectStore<EventGroup> eventGroups
A map of EventGroup objects. These represent one or more messages to be agregated, keyed by message id. There will be one response message for every EventGroup.


groupsLock

protected final Object groupsLock

processedGroups

protected ObjectStore<Long> processedGroups
Constructor Detail

EventCorrelator

public EventCorrelator(EventCorrelatorCallback callback,
                       MessageProcessor timeoutMessageProcessor,
                       MessageInfoMapping messageInfoMapping,
                       MuleContext muleContext,
                       String flowConstructName,
                       boolean persistentStores,
                       String storePrefix)
Method Detail

forceGroupExpiry

public void forceGroupExpiry(String groupId)
                      throws MessagingException
Throws:
MessagingException

process

public MuleEvent process(MuleEvent event)
                  throws RoutingException
Throws:
RoutingException

getEventGroup

protected EventGroup getEventGroup(String groupId)
                            throws ObjectStoreException
Throws:
ObjectStoreException

addEventGroup

protected EventGroup addEventGroup(EventGroup group)
                            throws ObjectStoreException
Throws:
ObjectStoreException

removeEventGroup

protected void removeEventGroup(EventGroup group)
                         throws ObjectStoreException
Throws:
ObjectStoreException

addProcessedGroup

protected void addProcessedGroup(Object id)
                          throws ObjectStoreException
Throws:
ObjectStoreException

isGroupAlreadyProcessed

protected boolean isGroupAlreadyProcessed(Object id)
                                   throws ObjectStoreException
Throws:
ObjectStoreException

isFailOnTimeout

public boolean isFailOnTimeout()

setFailOnTimeout

public void setFailOnTimeout(boolean failOnTimeout)

getTimeout

public long getTimeout()

setTimeout

public void setTimeout(long timeout)

handleGroupExpiry

protected void handleGroupExpiry(EventGroup group)
                          throws MessagingException
Throws:
MessagingException

start

public void start()
           throws MuleException
Specified by:
start in interface Startable
Throws:
MuleException

stop

public void stop()
          throws MuleException
Specified by:
stop in interface Stoppable
Throws:
MuleException


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