1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.endpoint; |
12 | |
|
13 | |
import org.mule.api.MuleContext; |
14 | |
import org.mule.api.MuleEvent; |
15 | |
import org.mule.api.MuleMessage; |
16 | |
import org.mule.api.endpoint.EndpointURI; |
17 | |
import org.mule.api.endpoint.OutboundEndpoint; |
18 | |
import org.mule.api.routing.filter.Filter; |
19 | |
import org.mule.api.security.EndpointSecurityFilter; |
20 | |
import org.mule.api.transaction.TransactionConfig; |
21 | |
import org.mule.api.transport.ConnectionStrategy; |
22 | |
import org.mule.api.transport.Connector; |
23 | |
import org.mule.api.transport.DispatchException; |
24 | |
import org.mule.config.MuleManifest; |
25 | |
|
26 | |
import java.util.List; |
27 | |
import java.util.Map; |
28 | |
|
29 | |
public class DefaultOutboundEndpoint extends AbstractEndpoint implements OutboundEndpoint |
30 | |
{ |
31 | |
|
32 | |
private static final long serialVersionUID = 8860985949279708638L; |
33 | |
|
34 | |
public DefaultOutboundEndpoint(Connector connector, |
35 | |
EndpointURI endpointUri, |
36 | |
List transformers, |
37 | |
List responseTransformers, |
38 | |
String name, |
39 | |
Map properties, |
40 | |
TransactionConfig transactionConfig, |
41 | |
Filter filter, |
42 | |
boolean deleteUnacceptedMessage, |
43 | |
EndpointSecurityFilter securityFilter, |
44 | |
boolean synchronous, |
45 | |
boolean remoteSync, |
46 | |
int remoteSyncTimeout, |
47 | |
String initialState, |
48 | |
String endpointEncoding, |
49 | |
MuleContext muleContext, |
50 | |
ConnectionStrategy connectionStrategy) |
51 | |
{ |
52 | 418 | super(connector, endpointUri, transformers, responseTransformers, name, properties, transactionConfig, filter, |
53 | |
deleteUnacceptedMessage, securityFilter, synchronous, remoteSync, remoteSyncTimeout, initialState, |
54 | |
endpointEncoding, muleContext, connectionStrategy); |
55 | 418 | } |
56 | |
|
57 | |
public void dispatch(MuleEvent event) throws DispatchException |
58 | |
{ |
59 | 0 | if (getConnector() != null) |
60 | |
{ |
61 | 0 | getConnector().dispatch(this, event); |
62 | |
} |
63 | |
else |
64 | |
{ |
65 | |
|
66 | |
|
67 | 0 | throw new IllegalStateException("The connector on the endpoint: " + toString() |
68 | |
+ " is null. Please contact " + MuleManifest.getDevListEmail()); |
69 | |
} |
70 | 0 | } |
71 | |
|
72 | |
public MuleMessage send(MuleEvent event) throws DispatchException |
73 | |
{ |
74 | 8 | if (getConnector() != null) |
75 | |
{ |
76 | 8 | return getConnector().send(this, event); |
77 | |
} |
78 | |
else |
79 | |
{ |
80 | |
|
81 | |
|
82 | 0 | throw new IllegalStateException("The connector on the endpoint: " + toString() |
83 | |
+ " is null. Please contact " + MuleManifest.getDevListEmail()); |
84 | |
} |
85 | |
} |
86 | |
} |