1
2
3
4
5
6
7
8
9
10
11 package org.mule.routing;
12
13 import org.mule.impl.MuleEvent;
14 import org.mule.umo.UMOMessage;
15 import org.mule.umo.UMOSession;
16 import org.mule.umo.endpoint.UMOEndpoint;
17 import org.mule.umo.routing.RoutingException;
18
19 import org.apache.commons.logging.Log;
20 import org.apache.commons.logging.LogFactory;
21
22
23
24
25
26
27
28 public class LoggingCatchAllStrategy extends AbstractCatchAllStrategy
29 {
30 private static final Log logger = LogFactory.getLog(MuleEvent.class);
31
32 public void setEndpoint(UMOEndpoint endpoint)
33 {
34 throw new UnsupportedOperationException("An endpoint cannot be set on this Catch All strategy");
35 }
36
37 public void setEndpoint(String endpoint)
38 {
39 throw new UnsupportedOperationException("An endpoint cannot be set on this Catch All strategy");
40 }
41
42 public UMOEndpoint getEndpoint()
43 {
44 return null;
45 }
46
47 public UMOMessage catchMessage(UMOMessage message, UMOSession session, boolean synchronous)
48 throws RoutingException
49 {
50 logger.warn("Message: " + message + " was not dispatched on session: " + session
51 + ". No routing path was defined for it.");
52 return null;
53 }
54 }