org.apache.camel.processor.aggregate
Class DefaultAggregationCollection

java.lang.Object
  extended by java.util.AbstractCollection<Exchange>
      extended by org.apache.camel.processor.aggregate.DefaultAggregationCollection
All Implemented Interfaces:
Iterable<Exchange>, Collection<Exchange>, AggregationCollection
Direct Known Subclasses:
AggregateRssFeedCollection, PredicateAggregationCollection

public class DefaultAggregationCollection
extends AbstractCollection<Exchange>
implements AggregationCollection

A Collection which aggregates exchanges together using a correlation expression so that there is only a single message exchange sent for a single correlation key.

Version:
$Revision: 17047 $

Constructor Summary
DefaultAggregationCollection()
           
DefaultAggregationCollection(Expression correlationExpression, AggregationStrategy aggregationStrategy)
           
 
Method Summary
 boolean add(Exchange exchange)
          Adds the given exchange to this collection
 void clear()
          Clears this collection
protected  Map<Object,Exchange> getAggregated()
           
 AggregationStrategy getAggregationStrategy()
          Gets the aggregation strategy
 Expression getCorrelationExpression()
          Gets the correlation expression
 Iterator<Exchange> iterator()
          Gets the iterator to iterate this collection.
 void onAggregation(Object correlationKey, Exchange exchange)
          A strategy method allowing derived classes such as PredicateAggregationCollection to check to see if the aggregation has completed
 void setAggregationStrategy(AggregationStrategy aggregationStrategy)
          Sets the aggregation strategy to be used
 void setCorrelationExpression(Expression correlationExpression)
          Sets the correlation expression to be used
 int size()
          Gets the size of this collection
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
addAll, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

DefaultAggregationCollection

public DefaultAggregationCollection()

DefaultAggregationCollection

public DefaultAggregationCollection(Expression correlationExpression,
                                    AggregationStrategy aggregationStrategy)
Method Detail

getAggregated

protected Map<Object,Exchange> getAggregated()

add

public boolean add(Exchange exchange)
Description copied from interface: AggregationCollection
Adds the given exchange to this collection

Specified by:
add in interface Collection<Exchange>
Specified by:
add in interface AggregationCollection
Overrides:
add in class AbstractCollection<Exchange>

iterator

public Iterator<Exchange> iterator()
Description copied from interface: AggregationCollection
Gets the iterator to iterate this collection.

Specified by:
iterator in interface Iterable<Exchange>
Specified by:
iterator in interface Collection<Exchange>
Specified by:
iterator in interface AggregationCollection
Specified by:
iterator in class AbstractCollection<Exchange>

size

public int size()
Description copied from interface: AggregationCollection
Gets the size of this collection

Specified by:
size in interface Collection<Exchange>
Specified by:
size in interface AggregationCollection
Specified by:
size in class AbstractCollection<Exchange>

clear

public void clear()
Description copied from interface: AggregationCollection
Clears this collection

Specified by:
clear in interface Collection<Exchange>
Specified by:
clear in interface AggregationCollection
Overrides:
clear in class AbstractCollection<Exchange>

onAggregation

public void onAggregation(Object correlationKey,
                          Exchange exchange)
Description copied from interface: AggregationCollection
A strategy method allowing derived classes such as PredicateAggregationCollection to check to see if the aggregation has completed

Specified by:
onAggregation in interface AggregationCollection

getCorrelationExpression

public Expression getCorrelationExpression()
Description copied from interface: AggregationCollection
Gets the correlation expression

Specified by:
getCorrelationExpression in interface AggregationCollection

setCorrelationExpression

public void setCorrelationExpression(Expression correlationExpression)
Description copied from interface: AggregationCollection
Sets the correlation expression to be used

Specified by:
setCorrelationExpression in interface AggregationCollection

getAggregationStrategy

public AggregationStrategy getAggregationStrategy()
Description copied from interface: AggregationCollection
Gets the aggregation strategy

Specified by:
getAggregationStrategy in interface AggregationCollection

setAggregationStrategy

public void setAggregationStrategy(AggregationStrategy aggregationStrategy)
Description copied from interface: AggregationCollection
Sets the aggregation strategy to be used

Specified by:
setAggregationStrategy in interface AggregationCollection


Copyright © 2007-2010 IONA Open Source Community. All Rights Reserved.