org.apache.synapse.mediators.eip.aggregator
Class AggregateMediator

java.lang.Object
  extended by org.apache.synapse.mediators.AbstractMediator
      extended by org.apache.synapse.mediators.eip.aggregator.AggregateMediator
All Implemented Interfaces:
Mediator

public class AggregateMediator
extends AbstractMediator

Aggregate a number of messages that are determined to be for a particular group, and combine them to form a single message which is then processed through the 'onComplete' sequence. Thus an aggregator acts like a filter, and may look at a correlation XPath expression to select messages for aggregation - or look at messageSequence number properties for aggregation or let any other (i.e. non aggregatable) messages flow through An instance of this mediator will register with a Timer to be notified after a specified timeout, so that aggregations that never would complete could be timed out and cleared from memory and any fault conditions handled


Field Summary
 
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
traceState
 
Constructor Summary
AggregateMediator()
           
 
Method Summary
 void completeAggregate(Aggregate aggregate)
          Invoked by the Aggregate objects that are timed out, to signal timeout/completion of itself
 Map getActiveAggregates()
           
 SynapseXPath getAggregationExpression()
           
 long getCompletionTimeoutMillis()
           
 SynapseXPath getCorrelateExpression()
           
 int getMaxMessagesToComplete()
           
 int getMinMessagesToComplete()
           
 SequenceMediator getOnCompleteSequence()
           
 String getOnCompleteSequenceRef()
           
 boolean mediate(MessageContext synCtx)
          Aggregate messages flowing through this mediator according to the correlation criteria and the aggregation algorithm specified to it
 void setAggregationExpression(SynapseXPath aggregationExpression)
           
 void setCompletionTimeoutMillis(long completionTimeoutMillis)
           
 void setCorrelateExpression(SynapseXPath correlateExpression)
           
 void setMaxMessagesToComplete(int maxMessagesToComplete)
           
 void setMinMessagesToComplete(int minMessagesToComplete)
           
 void setOnCompleteSequence(SequenceMediator onCompleteSequence)
           
 void setOnCompleteSequenceRef(String onCompleteSequenceRef)
           
 
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, getTraceState, getType, handleException, handleException, isTraceOn, isTraceOrDebugOn, setEffectiveTraceState, setTraceState, shouldTrace, traceOrDebug, traceOrDebugWarn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateMediator

public AggregateMediator()
Method Detail

mediate

public boolean mediate(MessageContext synCtx)
Aggregate messages flowing through this mediator according to the correlation criteria and the aggregation algorithm specified to it

Parameters:
synCtx - - MessageContext to be mediated and aggregated
Returns:
boolean true if the complete condition for the particular aggregate is validated

completeAggregate

public void completeAggregate(Aggregate aggregate)
Invoked by the Aggregate objects that are timed out, to signal timeout/completion of itself

Parameters:
aggregate - the timed out Aggregate that holds collected messages and properties

getCorrelateExpression

public SynapseXPath getCorrelateExpression()

setCorrelateExpression

public void setCorrelateExpression(SynapseXPath correlateExpression)

getCompletionTimeoutMillis

public long getCompletionTimeoutMillis()

setCompletionTimeoutMillis

public void setCompletionTimeoutMillis(long completionTimeoutMillis)

getMinMessagesToComplete

public int getMinMessagesToComplete()

setMinMessagesToComplete

public void setMinMessagesToComplete(int minMessagesToComplete)

getMaxMessagesToComplete

public int getMaxMessagesToComplete()

setMaxMessagesToComplete

public void setMaxMessagesToComplete(int maxMessagesToComplete)

getAggregationExpression

public SynapseXPath getAggregationExpression()

setAggregationExpression

public void setAggregationExpression(SynapseXPath aggregationExpression)

getOnCompleteSequenceRef

public String getOnCompleteSequenceRef()

setOnCompleteSequenceRef

public void setOnCompleteSequenceRef(String onCompleteSequenceRef)

getOnCompleteSequence

public SequenceMediator getOnCompleteSequence()

setOnCompleteSequence

public void setOnCompleteSequence(SequenceMediator onCompleteSequence)

getActiveAggregates

public Map getActiveAggregates()


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.