View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.service;
8   
9   import org.mule.MessageExchangePattern;
10  import org.mule.api.MuleException;
11  import org.mule.api.construct.FlowConstruct;
12  import org.mule.api.context.MuleContextAware;
13  import org.mule.api.endpoint.EndpointBuilder;
14  import org.mule.api.endpoint.EndpointURIBuilder;
15  import org.mule.api.endpoint.ImmutableEndpoint;
16  import org.mule.api.endpoint.InboundEndpoint;
17  import org.mule.api.registry.ServiceDescriptor;
18  import org.mule.api.transaction.TransactionFactory;
19  import org.mule.api.transformer.Transformer;
20  import org.mule.api.transport.Connector;
21  import org.mule.api.transport.MessageDispatcherFactory;
22  import org.mule.api.transport.MessageReceiver;
23  import org.mule.api.transport.MessageRequesterFactory;
24  import org.mule.api.transport.MuleMessageFactory;
25  import org.mule.api.transport.SessionHandler;
26  import org.mule.endpoint.EndpointURIEndpointBuilder;
27  
28  import java.util.List;
29  import java.util.Properties;
30  
31  /**
32   * <code>TransportServiceDescriptor</code> describes the necessary information for
33   * creating a connector from a service descriptor. A service descriptor should be
34   * located at META-INF/services/org/mule/providers/<protocol> where protocol is the
35   * protocol of the connector to be created The service descriptor is in the form of
36   * string key value pairs and supports a number of properties, descriptions of which
37   * can be found here: http://www.mulesoft.org/documentation/display/MULE3USER/Transport+Service+Descriptors
38   */
39  public interface TransportServiceDescriptor extends ServiceDescriptor, MuleContextAware
40  {
41      public static final String OSGI_HEADER_TRANSPORT = "Mule-Transport";
42  
43      MuleMessageFactory createMuleMessageFactory() throws TransportServiceException;
44  
45      SessionHandler createSessionHandler() throws TransportServiceException;
46  
47      MessageReceiver createMessageReceiver(Connector connector,
48                                                   FlowConstruct flowConstruct,
49                                                   InboundEndpoint endpoint) throws MuleException;
50  
51      MessageReceiver createMessageReceiver(Connector connector,
52                                                   FlowConstruct flowConstruct,
53                                                   InboundEndpoint endpoint,
54                                                   Object... args) throws MuleException;
55  
56      MessageDispatcherFactory createDispatcherFactory() throws TransportServiceException;
57  
58      MessageRequesterFactory createRequesterFactory() throws TransportServiceException;
59  
60      TransactionFactory createTransactionFactory() throws TransportServiceException;
61  
62      Connector createConnector() throws TransportServiceException;
63  
64      List<Transformer> createInboundTransformers(ImmutableEndpoint endpoint) throws TransportFactoryException;
65  
66      List<Transformer> createOutboundTransformers(ImmutableEndpoint endpoint) throws TransportFactoryException;
67  
68      List<Transformer> createResponseTransformers(ImmutableEndpoint endpoint) throws TransportFactoryException;
69  
70      EndpointURIBuilder createEndpointURIBuilder() throws TransportFactoryException;
71  
72      EndpointBuilder createEndpointBuilder(String uri) throws TransportFactoryException;
73  
74      EndpointBuilder createEndpointBuilder(EndpointURIEndpointBuilder builder) throws TransportFactoryException;
75  
76      void setExceptionMappings(Properties props);
77  
78      Properties getExceptionMappings();
79  
80      List<MessageExchangePattern> getInboundExchangePatterns() throws TransportServiceException;
81  
82      List<MessageExchangePattern> getOutboundExchangePatterns() throws TransportServiceException;
83  
84      MessageExchangePattern getDefaultExchangePattern() throws TransportServiceException;
85  }