1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.routing; |
8 | |
|
9 | |
import org.mule.api.MuleEvent; |
10 | |
import org.mule.api.MuleException; |
11 | |
import org.mule.api.routing.RoutingException; |
12 | |
import org.mule.api.service.Service; |
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
@Deprecated |
20 | 0 | public class ServiceCatchAllStrategy extends AbstractCatchAllStrategy |
21 | |
{ |
22 | |
@Override |
23 | |
public synchronized MuleEvent doCatchMessage(MuleEvent event) |
24 | |
throws RoutingException |
25 | |
{ |
26 | 0 | if (!(event.getFlowConstruct() instanceof Service)) |
27 | |
{ |
28 | 0 | throw new UnsupportedOperationException( |
29 | |
"CollectionResponseWithCallbackCorrelator is only supported with Service"); |
30 | |
} |
31 | |
|
32 | 0 | logger.debug("Catch all strategy handling event: " + event); |
33 | |
try |
34 | |
{ |
35 | 0 | if (event.getEndpoint().getExchangePattern().hasResponse()) |
36 | |
{ |
37 | 0 | if (statistics.isEnabled()) |
38 | |
{ |
39 | 0 | statistics.incrementRoutedMessage(event.getEndpoint()); |
40 | |
} |
41 | 0 | return ((Service) event.getFlowConstruct()).sendEvent(event); |
42 | |
} |
43 | |
else |
44 | |
{ |
45 | 0 | if (statistics.isEnabled()) |
46 | |
{ |
47 | 0 | statistics.incrementRoutedMessage(event.getEndpoint()); |
48 | |
} |
49 | 0 | ((Service) event.getFlowConstruct()).dispatchEvent(event); |
50 | 0 | return null; |
51 | |
} |
52 | |
} |
53 | 0 | catch (MuleException e) |
54 | |
{ |
55 | 0 | throw new RoutingException(event, this, e); |
56 | |
} |
57 | |
} |
58 | |
} |