org.mule.routing.inbound
Class AbstractEventAggregator
java.lang.Object
org.mule.routing.inbound.SelectiveConsumer
org.mule.routing.inbound.AbstractEventAggregator
- All Implemented Interfaces:
- UMOInboundRouter, UMORouter
- Direct Known Subclasses:
- CorrelationAggregator
- public abstract class AbstractEventAggregator
- extends SelectiveConsumer
AbstractEventAggregator
will aggregate a set of messages into a single message
- Version:
- $Revision: 1.3 $
- Author:
- Ross Mason
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NO_CORRELATION_ID
protected static final java.lang.String NO_CORRELATION_ID
- See Also:
- Constant Field Values
eventGroups
protected java.util.Map eventGroups
AbstractEventAggregator
public AbstractEventAggregator()
process
public UMOEvent[] process(UMOEvent event)
throws MessagingException
- Specified by:
process
in interface UMOInboundRouter
- Overrides:
process
in class SelectiveConsumer
- Throws:
MessagingException
addEvent
protected EventGroup addEvent(UMOEvent event)
- Adds the event to an event group. Groups are defined by the correlationId
on the message. If no correlationId is set a default group is created for
all events without a correlationId.
If there is no group for the current correlationId one will be created and added
to the router.
- Parameters:
event
-
- Returns:
removeGroup
protected void removeGroup(java.lang.String id)
shouldAggregate
protected abstract boolean shouldAggregate(EventGroup events)
- Determines if the event group is ready to be aggregated.
if the group is ready to be aggregated (this is entirely up
to the application. it could be determined by volume, last modified time
or some oher criteria based on the last event received)
- Parameters:
events
-
- Returns:
aggregateEvents
protected abstract UMOMessage aggregateEvents(EventGroup events)
throws RoutingException
- This method is invoked if the shouldAggregate method is called and returns
true. Once this method returns an aggregated message the event group is removed
from the router
- Parameters:
events
- the event group for this request
- Returns:
- an aggregated message
- Throws:
RoutingException
- if the aggregation fails. in this scenario the whole
event group is removed and passed to the exception handler for this
componenet
Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.