01: /*
02: * $Id: DefaultOutboundEndpoint.java 11311 2008-03-10 20:15:57Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
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
30: OutboundEndpoint {
31:
32: private static final long serialVersionUID = 8860985949279708638L;
33:
34: public DefaultOutboundEndpoint(Connector connector,
35: EndpointURI endpointUri, List transformers,
36: List responseTransformers, String name, Map properties,
37: TransactionConfig transactionConfig, Filter filter,
38: boolean deleteUnacceptedMessage,
39: EndpointSecurityFilter securityFilter, boolean synchronous,
40: boolean remoteSync, int remoteSyncTimeout,
41: String initialState, String endpointEncoding,
42: MuleContext muleContext,
43: ConnectionStrategy connectionStrategy) {
44: super (connector, endpointUri, transformers,
45: responseTransformers, name, properties,
46: transactionConfig, filter, deleteUnacceptedMessage,
47: securityFilter, synchronous, remoteSync,
48: remoteSyncTimeout, initialState, endpointEncoding,
49: muleContext, connectionStrategy);
50: }
51:
52: public void dispatch(MuleEvent event) throws DispatchException {
53: if (getConnector() != null) {
54: getConnector().dispatch(this , event);
55: } else {
56: // TODO Either remove because this should never happen or i18n the
57: // message
58: throw new IllegalStateException(
59: "The connector on the endpoint: " + toString()
60: + " is null. Please contact "
61: + MuleManifest.getDevListEmail());
62: }
63: }
64:
65: public MuleMessage send(MuleEvent event) throws DispatchException {
66: if (getConnector() != null) {
67: return getConnector().send(this , event);
68: } else {
69: // TODO Either remove because this should never happen or i18n the
70: // message
71: throw new IllegalStateException(
72: "The connector on the endpoint: " + toString()
73: + " is null. Please contact "
74: + MuleManifest.getDevListEmail());
75: }
76: }
77: }
|