org.mule.routing.response
Class AbstractResponseAggregator
java.lang.Object
org.mule.routing.AbstractRouter
org.mule.routing.response.AbstractResponseRouter
org.mule.routing.response.AbstractResponseAggregator
- All Implemented Interfaces:
- UMOResponseRouter, UMORouter
- Direct Known Subclasses:
- ResponseCorrelationAggregator, SingleResponseRouter
- public abstract class AbstractResponseAggregator
- extends AbstractResponseRouter
AbstractResponseAggregator
provides a base class for implementing
response aggregator routers. This provides a thread-safe implemenetation and
allows developers to customise how and when events are grouped and collated.
Response Agrregators are used to collect responses that are usually sent to
replyTo endpoints set on outbound routers. When an event is sent out via an
outbound router, the response router will block the response flow on an
UMOComponent until the Response Router resolves a reply or times out.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
eventGroups
protected final 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 ConcurrentMap locks
- A map of locks used to wait for response messages for a given message id
responseMessages
protected final ConcurrentMap responseMessages
- The collection of messages that are ready to be returned to the callee. Keyed
by Message ID
AbstractResponseAggregator
public AbstractResponseAggregator()
process
public void process(UMOEvent event)
throws RoutingException
- Description copied from interface:
UMOResponseRouter
- This method is invoked when an event is received via an endpoint on this
Response Router. It is responsible for tieing up the event it receives with
responses waiting to return back to the callee. This method will be called by
a different thread to the getResponse method. The getResponse() method block
the response execution until the process method signals that a match is found.
- Parameters:
event
-
- Throws:
RoutingException
createEventGroup
protected EventGroup createEventGroup(UMOEvent event,
Object groupId)
- See Also:
AbstractEventAggregator.createEventGroup(UMOEvent, Object)
getEventGroup
protected EventGroup getEventGroup(Object groupId)
- See Also:
AbstractEventAggregator.getEventGroup(Object)
addEventGroup
protected EventGroup addEventGroup(EventGroup group)
- See Also:
AbstractEventAggregator.addEventGroup(EventGroup)
removeEventGroup
protected void removeEventGroup(EventGroup group)
- See Also:
AbstractEventAggregator.removeEventGroup(EventGroup)
getResponse
public UMOMessage getResponse(UMOMessage message)
throws RoutingException
- This method is called by the responding callee thread and should return the
aggregated response message
- Parameters:
message
-
- Returns:
-
- Throws:
RoutingException
- See Also:
UMOMessage
,
UMOComponent
shouldAggregateEvents
protected abstract boolean shouldAggregateEvents(EventGroup events)
- See Also:
AbstractEventAggregator.shouldAggregateEvents(EventGroup)
aggregateEvents
protected abstract UMOMessage aggregateEvents(EventGroup events)
throws RoutingException
- Throws:
RoutingException
- See Also:
AbstractEventAggregator.aggregateEvents(EventGroup)
Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.