1
2
3
4
5
6
7
8
9
10
11 package org.mule.test.integration.streaming;
12
13 import org.mule.api.MuleEvent;
14 import org.mule.api.MuleException;
15 import org.mule.api.MuleMessage;
16 import org.mule.api.endpoint.OutboundEndpoint;
17 import org.mule.api.transport.MessageDispatcher;
18 import org.mule.api.transport.MessageDispatcherFactory;
19 import org.mule.transport.vm.VMMessageDispatcher;
20
21 public class ExceptionThrowingVMMessageDispatcherFactory implements MessageDispatcherFactory
22 {
23
24 public void activate(OutboundEndpoint endpoint, MessageDispatcher dispatcher) throws MuleException
25 {
26 }
27
28 public MessageDispatcher create(OutboundEndpoint endpoint) throws MuleException
29 {
30 return new ExceptionThrowingVMMessageDispatcher(endpoint);
31 }
32
33 public void destroy(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
34 {
35
36
37 }
38
39 public boolean isCreateDispatcherPerRequest()
40 {
41
42 return false;
43 }
44
45 public void passivate(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
46 {
47
48
49 }
50
51 public boolean validate(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
52 {
53 return true;
54 }
55
56 class ExceptionThrowingVMMessageDispatcher extends VMMessageDispatcher
57 {
58
59 public ExceptionThrowingVMMessageDispatcher(OutboundEndpoint endpoint)
60 {
61 super(endpoint);
62 }
63
64
65 protected MuleMessage doSend(MuleEvent event) throws Exception
66 {
67 throw new RuntimeException("");
68 }
69
70
71 protected void doDispatch(MuleEvent event) throws Exception
72 {
73 throw new RuntimeException("");
74 }
75 }
76
77 }