View Javadoc

1   /*
2    * $Id: DefaultInboundEndpoint.java 11311 2008-03-10 20:15:57Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.endpoint;
12  
13  import org.mule.api.MuleContext;
14  import org.mule.api.MuleMessage;
15  import org.mule.api.endpoint.EndpointURI;
16  import org.mule.api.endpoint.InboundEndpoint;
17  import org.mule.api.routing.filter.Filter;
18  import org.mule.api.security.EndpointSecurityFilter;
19  import org.mule.api.transaction.TransactionConfig;
20  import org.mule.api.transport.ConnectionStrategy;
21  import org.mule.api.transport.Connector;
22  import org.mule.config.MuleManifest;
23  
24  import java.util.List;
25  import java.util.Map;
26  
27  public class DefaultInboundEndpoint extends AbstractEndpoint implements InboundEndpoint
28  {
29  
30      private static final long serialVersionUID = -4752772777414636142L;
31  
32      public DefaultInboundEndpoint(Connector connector,
33                                    EndpointURI endpointUri,
34                                    List transformers,
35                                    List responseTransformers,
36                                    String name,
37                                    Map properties,
38                                    TransactionConfig transactionConfig,
39                                    Filter filter,
40                                    boolean deleteUnacceptedMessage,
41                                    EndpointSecurityFilter securityFilter,
42                                    boolean synchronous,
43                                    boolean remoteSync,
44                                    int remoteSyncTimeout,
45                                    String initialState,
46                                    String endpointEncoding,
47                                    MuleContext muleContext,
48                                    ConnectionStrategy connectionStrategy)
49      {
50          super(connector, endpointUri, transformers, responseTransformers, name, properties, transactionConfig, filter,
51              deleteUnacceptedMessage, securityFilter, synchronous, remoteSync, remoteSyncTimeout, initialState,
52              endpointEncoding, muleContext, connectionStrategy);
53      }
54  
55      public MuleMessage request(long timeout) throws Exception
56      {
57          if (getConnector() != null)
58          {
59              return getConnector().request(this, timeout);
60          }
61          else
62          {
63              // TODO Either remove because this should never happen or i18n the
64              // message
65              throw new IllegalStateException("The connector on the endpoint: " + toString()
66                                              + " is null. Please contact " + MuleManifest.getDevListEmail());
67          }
68      }
69  
70  }