1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.tck.testmodels.mule; |
12 | |
|
13 | |
import org.mule.providers.AbstractMessageDispatcher; |
14 | |
import org.mule.umo.UMOEvent; |
15 | |
import org.mule.umo.UMOMessage; |
16 | |
import org.mule.umo.endpoint.UMOImmutableEndpoint; |
17 | |
import org.mule.umo.routing.RoutingException; |
18 | |
|
19 | |
public class TestMessageDispatcher extends AbstractMessageDispatcher |
20 | |
{ |
21 | |
|
22 | |
public TestMessageDispatcher(final UMOImmutableEndpoint endpoint) |
23 | |
{ |
24 | 4 | super(endpoint); |
25 | 4 | } |
26 | |
|
27 | |
protected void doDispose() |
28 | |
{ |
29 | |
|
30 | 0 | } |
31 | |
|
32 | |
protected void doDispatch(UMOEvent event) throws Exception |
33 | |
{ |
34 | 0 | if (event.getEndpoint().getEndpointURI().toString().equals("test://AlwaysFail")) |
35 | |
{ |
36 | 0 | throw new RoutingException(event.getMessage(), event.getEndpoint()); |
37 | |
} |
38 | 0 | } |
39 | |
|
40 | |
protected UMOMessage doSend(UMOEvent event) throws Exception |
41 | |
{ |
42 | 10 | if (event.getEndpoint().getEndpointURI().toString().equals("test://AlwaysFail")) |
43 | |
{ |
44 | 0 | throw new RoutingException(event.getMessage(), event.getEndpoint()); |
45 | |
} |
46 | 10 | return event.getMessage(); |
47 | |
} |
48 | |
|
49 | |
public UMOMessage doReceive(long timeout) throws Exception |
50 | |
{ |
51 | 0 | return null; |
52 | |
} |
53 | |
|
54 | |
protected void doConnect() throws Exception |
55 | |
{ |
56 | |
|
57 | 4 | } |
58 | |
|
59 | |
protected void doDisconnect() throws Exception |
60 | |
{ |
61 | |
|
62 | 0 | } |
63 | |
|
64 | |
} |