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