|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.mule.routing.response.AbstractResponseRouter
org.mule.routing.response.AbstractResponseAggregator
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.
| Field Summary | |
protected ConcurrentMap |
eventGroups
Map of EventGroup objects. |
protected ConcurrentMap |
responseEvents
The collection of messages that are ready to be returned to the callee. |
| Fields inherited from class org.mule.routing.response.AbstractResponseRouter |
correlationExtractor, logger |
| Constructor Summary | |
AbstractResponseAggregator()
|
|
| Method Summary | |
protected EventGroup |
addEvent(UMOEvent event)
Adds the event to an event group. |
protected abstract UMOMessage |
aggregateEvents(EventGroup events)
This method is invoked if the shouldAggregate method is called and returns true. |
protected EventGroup |
createEventGroup(Object id,
UMOEvent event)
Creates a new event group with the given Id and can use other properties on the event Custom implementations can even overload the eventGroup object here |
UMOMessage |
getResponse(UMOMessage message)
This method is called by the responding callee thread and should return the aggregated response message |
void |
process(UMOEvent event)
This method is invoked when an event is received via an endpoint on this Response Router. |
protected void |
removeEventGroup(Object id)
|
protected abstract boolean |
shouldAggregate(EventGroup events)
Determines if the event group is ready to be aggregated. |
| Methods inherited from class org.mule.routing.response.AbstractResponseRouter |
getCallResponseAggregateIdentifier, getCorrelationExtractor, getReplyAggregateIdentifier, getRouterStatistics, getTimeout, setCorrelationExtractor, setPropertyExtractorAsString, setRouterStatistics, setTimeout |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ConcurrentMap responseEvents
protected final ConcurrentMap eventGroups
| Constructor Detail |
public AbstractResponseAggregator()
| Method Detail |
public void process(UMOEvent event)
throws RoutingException
UMOResponseRouter
event -
RoutingException
protected EventGroup addEvent(UMOEvent event)
throws RoutingException
getReplyAggregateIdentifier() a routing exception will be
thrown
event - the reply event received by the response router
RoutingException
protected EventGroup createEventGroup(Object id,
UMOEvent event)
id - The Event group Id for the new Groupevent - the current event
protected void removeEventGroup(Object id)
public UMOMessage getResponse(UMOMessage message)
throws RoutingException
message -
RoutingExceptionUMOMessage,
UMOComponentprotected abstract boolean shouldAggregate(EventGroup events)
events -
protected abstract UMOMessage aggregateEvents(EventGroup events)
throws RoutingException
events - the event group for this request
RoutingException - if the aggregation fails. in this scenario the whole
event group is removed and passed to the exception handler for
this componenet
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||