}
}
}
protected void addAggregationDetails(Message message, String uuId, int recipientCount, long seriesTimestamp, int messageIndex) {
AggregationDetails aggrDetails = new AggregationDetails(uuId, messageIndex, recipientCount, seriesTimestamp);
ArrayList<String> aggregatorTags;
if(aggregatorOnProperties) {
aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(Aggregator.AGGEGRATOR_TAG);
} else {
aggregatorTags = (ArrayList<String>) message.getContext().getContext(Aggregator.AGGEGRATOR_TAG);
}
// This is useful during aggregation - as a way of id'ing where the split occurred.
aggrDetails.setSplitId(splitId);
if ((aggregatorTags == null) || !aggregatorOnProperties) {
if (aggregatorTags == null) {
aggregatorTags = new ArrayList<String>();
} else {
aggregatorTags = new ArrayList<String>(aggregatorTags) ;
}
if(aggregatorOnProperties) {
message.getProperties().setProperty(Aggregator.AGGEGRATOR_TAG, aggregatorTags);
} else {
message.getContext().setContext(Aggregator.AGGEGRATOR_TAG, aggregatorTags);
}
}
if(messageIndex > 1) {
// remove the tag string for the last recipient...
aggregatorTags.remove(aggregatorTags.size() - 1);
}
aggregatorTags.add(aggrDetails.toString());
if (logger.isDebugEnabled()) {
logger.debug(Aggregator. AGGEGRATOR_TAG + "=" + aggrDetails);
}
}