Class Aggregate
- java.lang.Object
-
- java.util.TimerTask
-
- org.apache.synapse.mediators.eip.aggregator.Aggregate
-
-
Constructor Summary
Constructors Constructor Description Aggregate(SynapseEnvironment synEnv, String corelation, long timeoutMillis, int min, int max, AggregateMediator mediator, FaultHandler faultHandler)
Save aggregation properties and timeout
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addMessage(MessageContext synCtx)
Add a message to the interlan message listvoid
clear()
Clear references in Aggregate Timer Task This need to be called when aggregation is completed.String
getCorrelation()
long
getExpiryTimeMillis()
MessageContext
getLastMessage()
boolean
getLock()
int
getMaxCount()
List<MessageContext>
getMessages()
int
getMinCount()
long
getTimeoutMillis()
boolean
isComplete(SynapseLog synLog)
Has this aggregation group completed?boolean
isCompleted()
void
releaseLock()
void
run()
void
setCompleted(boolean completed)
void
setCorrelation(String correlation)
void
setExpiryTimeMillis(long expiryTimeMillis)
void
setMaxCount(int maxCount)
void
setMessages(List<MessageContext> messages)
void
setMinCount(int minCount)
void
setTimeoutMillis(long timeoutMillis)
-
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
-
-
-
Constructor Detail
-
Aggregate
public Aggregate(SynapseEnvironment synEnv, String corelation, long timeoutMillis, int min, int max, AggregateMediator mediator, FaultHandler faultHandler)
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
-faultHandler
-
-
-
Method Detail
-
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
-
getLastMessage
public MessageContext getLastMessage()
-
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)
-
clear
public void clear()
Clear references in Aggregate Timer Task This need to be called when aggregation is completed. Task is not eligible for gc until it reach the execution time, even though it is cancelled. So we need to remove references from task to other objects to allow them to be garbage collected
-
getLock
public boolean getLock()
-
releaseLock
public void releaseLock()
-
isCompleted
public boolean isCompleted()
-
setCompleted
public void setCompleted(boolean completed)
-
-