org.apache.synapse.mediators.eip.aggregator
Class Aggregate
java.lang.Object
java.util.TimerTask
org.apache.synapse.mediators.eip.aggregator.Aggregate
- All Implemented Interfaces:
- Runnable
public class Aggregate
- extends TimerTask
An instance of this class is created to manage each aggregation group, and it holds
the aggregation properties and the messages collected during aggregation. This class also
times out itself after the timeout expires it
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Aggregate
public Aggregate(SynapseEnvironment synEnv,
String corelation,
long timeoutMillis,
int min,
int max,
AggregateMediator mediator)
- Save aggregation properties and timeout
- Parameters:
corelation
- representing the corelation name of the messages in the aggregatetimeoutMillis
- the timeout duration in millisecondsmin
- the minimum number of messages to be aggregatedmax
- the maximum number of messages to be aggregatedmediator
-
addMessage
public boolean addMessage(MessageContext synCtx)
- Add a message to the interlan message list
- Parameters:
synCtx
- message to be added into this aggregation group
- Returns:
- true if the message was added or false if not
isComplete
public boolean isComplete(SynapseLog synLog)
- Has this aggregation group completed?
- Parameters:
synLog
- the Synapse log to use
- Returns:
- boolean true if aggregation is complete
getTimeoutMillis
public long getTimeoutMillis()
setTimeoutMillis
public void setTimeoutMillis(long timeoutMillis)
getMinCount
public int getMinCount()
setMinCount
public void setMinCount(int minCount)
getMaxCount
public int getMaxCount()
setMaxCount
public void setMaxCount(int maxCount)
getCorrelation
public String getCorrelation()
setCorrelation
public void setCorrelation(String correlation)
getMessages
public List<MessageContext> getMessages()
setMessages
public void setMessages(List<MessageContext> messages)
getExpiryTimeMillis
public long getExpiryTimeMillis()
setExpiryTimeMillis
public void setExpiryTimeMillis(long expiryTimeMillis)
run
public void run()
- Specified by:
run
in interface Runnable
- Specified by:
run
in class TimerTask
getLock
public boolean getLock()
releaseLock
public void releaseLock()
isCompleted
public boolean isCompleted()
setCompleted
public void setCompleted(boolean completed)
Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.