1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.routing; |
12 | |
|
13 | |
import org.mule.DefaultMuleEvent; |
14 | |
import org.mule.api.MuleMessage; |
15 | |
import org.mule.api.MuleSession; |
16 | |
import org.mule.api.endpoint.OutboundEndpoint; |
17 | |
import org.mule.api.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 | 28 | public class LoggingCatchAllStrategy extends AbstractCatchAllStrategy |
29 | |
{ |
30 | 2 | private static final Log logger = LogFactory.getLog(DefaultMuleEvent.class); |
31 | |
|
32 | |
public void setEndpoint(OutboundEndpoint endpoint) |
33 | |
{ |
34 | 2 | throw new UnsupportedOperationException("An endpoint cannot be set on this Catch All strategy"); |
35 | |
} |
36 | |
|
37 | |
public void setEndpoint(String endpoint) |
38 | |
{ |
39 | 0 | throw new UnsupportedOperationException("An endpoint cannot be set on this Catch All strategy"); |
40 | |
} |
41 | |
|
42 | |
public OutboundEndpoint getEndpoint() |
43 | |
{ |
44 | 2 | return null; |
45 | |
} |
46 | |
|
47 | |
public MuleMessage catchMessage(MuleMessage message, MuleSession session, boolean synchronous) |
48 | |
throws RoutingException |
49 | |
{ |
50 | 8 | logger.warn("Message: " + message + " was not dispatched on session: " + session |
51 | |
+ ". No routing path was defined for it."); |
52 | 8 | return null; |
53 | |
} |
54 | |
} |