org.mule.routing
Class EventCorrelator

java.lang.Object
  extended by org.mule.routing.EventCorrelator

public class EventCorrelator
extends Object


Field Summary
protected  edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap eventGroups
          A map of EventGroup objects.
protected  Object groupsLock
           
protected  edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap locks
          A map of locks used to wait for response messages for a given message id
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  BoundedFifoBuffer processedGroups
           
protected  edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap responseMessages
          The collection of messages that are ready to be returned to the callee.
 
Constructor Summary
EventCorrelator(EventCorrelatorCallback callback, MessageInfoMapping messageInfoMapping, MuleContext context)
           
 
Method Summary
 void addEvent(MuleEvent event)
           
protected  EventGroup addEventGroup(EventGroup group)
           
protected  void addProcessedGroup(Object id)
           
 void enableTimeoutMonitor()
           
protected  EventGroup getEventGroup(Object groupId)
           
 MuleMessage getResponse(MuleMessage message)
          This method is called by the responding callee thread and should return the aggregated response message
 MuleMessage getResponse(MuleMessage message, int timeout)
          This method is called by the responding callee thread and should return the aggregated response message
 Map getResponseMessages()
          Deprecated. this is used by a test, but I would like to remove this method
 int getTimeout()
           
 boolean isFailOnTimeout()
           
protected  boolean isGroupAlreadyProcessed(Object id)
           
 MuleMessage process(MuleEvent event)
           
protected  void removeEventGroup(EventGroup group)
           
 void setFailOnTimeout(boolean failOnTimeout)
           
 void setTimeout(int timeout)
           
 
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

eventGroups

protected final edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap 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.


locks

protected final edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap locks
A map of locks used to wait for response messages for a given message id


responseMessages

protected final edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap responseMessages
The collection of messages that are ready to be returned to the callee. Keyed by Message ID


groupsLock

protected final Object groupsLock

processedGroups

protected final BoundedFifoBuffer processedGroups
Constructor Detail

EventCorrelator

public EventCorrelator(EventCorrelatorCallback callback,
                       MessageInfoMapping messageInfoMapping,
                       MuleContext context)
Method Detail

enableTimeoutMonitor

public void enableTimeoutMonitor()
                          throws javax.resource.spi.work.WorkException
Throws:
javax.resource.spi.work.WorkException

getResponseMessages

public Map getResponseMessages()
Deprecated. this is used by a test, but I would like to remove this method

Returns:

process

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

addEvent

public void addEvent(MuleEvent event)
              throws RoutingException
Throws:
RoutingException

getEventGroup

protected EventGroup getEventGroup(Object groupId)

addEventGroup

protected EventGroup addEventGroup(EventGroup group)

removeEventGroup

protected void removeEventGroup(EventGroup group)

addProcessedGroup

protected void addProcessedGroup(Object id)

isGroupAlreadyProcessed

protected boolean isGroupAlreadyProcessed(Object id)

getResponse

public MuleMessage getResponse(MuleMessage message)
                        throws RoutingException
This method is called by the responding callee thread and should return the aggregated response message

Parameters:
message -
Returns:
Throws:
RoutingException

getResponse

public MuleMessage getResponse(MuleMessage message,
                               int timeout)
                        throws RoutingException
This method is called by the responding callee thread and should return the aggregated response message

Parameters:
message -
Returns:
Throws:
RoutingException

isFailOnTimeout

public boolean isFailOnTimeout()

setFailOnTimeout

public void setFailOnTimeout(boolean failOnTimeout)

getTimeout

public int getTimeout()

setTimeout

public void setTimeout(int timeout)


Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.