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 public class ServiceCatchAllStrategy extends AbstractCatchAllStrategy
21 {
22 @Override
23 public synchronized MuleEvent doCatchMessage(MuleEvent event)
24 throws RoutingException
25 {
26 if (!(event.getFlowConstruct() instanceof Service))
27 {
28 throw new UnsupportedOperationException(
29 "CollectionResponseWithCallbackCorrelator is only supported with Service");
30 }
31
32 logger.debug("Catch all strategy handling event: " + event);
33 try
34 {
35 if (event.getEndpoint().getExchangePattern().hasResponse())
36 {
37 if (statistics.isEnabled())
38 {
39 statistics.incrementRoutedMessage(event.getEndpoint());
40 }
41 return ((Service) event.getFlowConstruct()).sendEvent(event);
42 }
43 else
44 {
45 if (statistics.isEnabled())
46 {
47 statistics.incrementRoutedMessage(event.getEndpoint());
48 }
49 ((Service) event.getFlowConstruct()).dispatchEvent(event);
50 return null;
51 }
52 }
53 catch (MuleException e)
54 {
55 throw new RoutingException(event, this, e);
56 }
57 }
58 }