1 10 11 package org.mule.routing.response; 12 13 import org.mule.routing.inbound.EventGroup; 14 import org.mule.umo.UMOEvent; 15 import org.mule.umo.UMOMessage; 16 import org.mule.umo.routing.RoutingException; 17 18 26 public class SingleResponseRouter extends AbstractResponseAggregator 27 { 28 39 protected boolean shouldAggregate(EventGroup events) 40 { 41 int size = events.expectedSize(); 42 if (size > 1) 43 { 44 logger.warn("Correlation Group Size is not 1. The SingleResponse Aggregator will only handle single replyTo events for a response router. If there will be multiple events for a single request use the 'ResponseCorrelationAggregator'"); 45 } 46 return true; 47 } 48 49 62 protected UMOMessage aggregateEvents(EventGroup events) throws RoutingException 63 { 64 return ((UMOEvent)events.iterator().next()).getMessage(); 65 } 66 67 } 68 | Popular Tags |