Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.routing
Class CollectionCorrelatorCallback

    java.lang.Object
      org.mule.routing.CollectionCorrelatorCallback

All Implemented Interfaces:
  EventCorrelatorCallback

Direct Known Subclasses:
  CollectionResponseWithCallbackCorrelator, ResequenceCorrelatorCallback

    public class CollectionCorrelatorCallback

extends Object
implements EventCorrelatorCallback

A Correlator that correlates messages based on Mule correlation settings

Field Summary
`protected Log` | `logger` logger used by this class
`protected MuleContext` | `muleContext`

Constructor Summary
`CollectionCorrelatorCallback(MuleContext muleContext)`

Method Summary
`MuleMessage` | `aggregateEvents(EventGroup events)` This method is invoked if the shouldAggregate method is called and returns true.
`EventGroup` | `createEventGroup(MuleEvent event, Object groupId)` Creates a new EventGroup that will expect the number of events as returned by `MessageAdapter.getCorrelationGroupSize()`.
`boolean` | `shouldAggregateEvents(EventGroup events)` Determines if the event group is ready to be aggregated.

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

### muleContext

    protected MuleContext muleContext

Constructor Detail

### CollectionCorrelatorCallback

    public CollectionCorrelatorCallback(MuleContext muleContext)

Method Detail

### aggregateEvents

    public MuleMessage aggregateEvents(EventGroup events)
                                throws AggregationException

  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.

  Specified by:
    `aggregateEvents` in interface `EventCorrelatorCallback`
  Parameters:
    `events` - the event group for this request
  Returns:
    an aggregated message
  Throws:
    `AggregationException` - if the aggregation fails. in this scenario the whole event group is removed and passed to the exception handler for this componenet

### createEventGroup

    public EventGroup createEventGroup(MuleEvent event,
                                       Object groupId)

  Creates a new EventGroup that will expect the number of events as returned by `MessageAdapter.getCorrelationGroupSize()`.

  Specified by:
    `createEventGroup` in interface `EventCorrelatorCallback`
  Parameters:
    `event` - the current event
    `groupId` - The group id
  Returns:
    a new event group of a fixed size

### shouldAggregateEvents

    public boolean shouldAggregateEvents(EventGroup events)

  Description copied from interface: `EventCorrelatorCallback`
  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).

  Specified by:
    `shouldAggregateEvents` in interface `EventCorrelatorCallback`
  Parameters:
    `events` - The current event group received by the correlator
  Returns:
    `true` if the correlation size is not set or exactly the expected size of the event group.
  See Also:
    `EventCorrelatorCallback.shouldAggregateEvents(org.mule.routing.inbound.EventGroup)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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