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