1 10 11 package org.mule.routing.response; 12 13 import org.mule.routing.inbound.EventGroup; 14 import org.mule.umo.UMOEvent; 15 16 20 21 public abstract class ResponseCorrelationAggregator extends AbstractResponseAggregator 22 { 23 32 protected boolean shouldAggregate(EventGroup events) 33 { 34 int expected = events.expectedSize(); 35 int current = events.size(); 36 37 if (expected == -1) 38 { 39 logger.warn("Correlation Group Size not set, but CorrelationAggregator is being used. Message is being forwarded"); 40 return true; 41 } 42 43 if (logger.isDebugEnabled()) 44 { 45 logger.debug("Correlation size is " + expected + ", current event group size is " + current 46 + " for correlation group " + events.getGroupId()); 47 } 48 49 return expected == current; 50 } 51 52 60 protected EventGroup createEventGroup(Object id, UMOEvent event) 61 { 62 int groupSize = event.getMessage().getCorrelationGroupSize(); 63 return new EventGroup(id, groupSize); 64 } 65 } 66 | Popular Tags |