1
2
3
4
5
6
7
8
9
10
11 package org.mule.example.loanbroker.routers;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.routing.AggregationException;
15 import org.mule.routing.CollectionCorrelatorCallback;
16 import org.mule.routing.EventCorrelatorCallback;
17 import org.mule.routing.inbound.EventGroup;
18 import org.mule.routing.response.ResponseCorrelationAggregator;
19
20
21
22
23
24 public class BankQuotesResponseAggregator extends ResponseCorrelationAggregator
25 {
26
27 protected EventCorrelatorCallback getCorrelatorCallback()
28 {
29 return new CollectionCorrelatorCallback()
30 {
31
32 public MuleMessage aggregateEvents(EventGroup events) throws AggregationException
33 {
34 try
35 {
36 return BankQuotesAggregationLogic.aggregateEvents(events);
37 }
38 catch (Exception e)
39 {
40 throw new AggregationException(events, null, e);
41 }
42 }
43 };
44 }
45 }