View Javadoc

1   /*
2    * $Id: EndpointBuilder.java 20297 2010-11-22 18:49:18Z aperepel $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.api.endpoint;
12  
13  import org.mule.MessageExchangePattern;
14  import org.mule.api.MuleContext;
15  import org.mule.api.context.MuleContextAware;
16  import org.mule.api.lifecycle.InitialisationException;
17  import org.mule.api.processor.MessageProcessor;
18  import org.mule.api.retry.RetryPolicyTemplate;
19  import org.mule.api.transaction.TransactionConfig;
20  import org.mule.api.transformer.Transformer;
21  import org.mule.api.transport.Connector;
22  import org.mule.endpoint.URIBuilder;
23  
24  import java.util.List;
25  import java.util.Map;
26  
27  /**
28   * Constructs endpoints. Transport specific endpoints can easily resolve the Endpoint implementation to be
29   * uses, for generic endpoints we can either resolve the transport from uri string or use a default
30   * implementation.
31   */
32  public interface EndpointBuilder extends MuleContextAware, Cloneable
33  {
34  
35      /**
36       * Constructs inbound endpoints
37       * 
38       * @throws EndpointException
39       * @throws InitialisationException
40       */
41      InboundEndpoint buildInboundEndpoint() throws EndpointException, InitialisationException;
42  
43      /**
44       * Constructs outbound endpoints
45       * 
46       * @throws EndpointException
47       * @throws InitialisationException
48       */
49      OutboundEndpoint buildOutboundEndpoint() throws EndpointException, InitialisationException;
50  
51      void setConnector(Connector connector);
52  
53      /** @deprecated Use addMessageProcessor() */
54      void addTransformer(Transformer transformer);
55  
56      /** @deprecated Use addResponseMessageProcessor() */
57      void addResponseTransformer(Transformer transformer);
58  
59      /** @deprecated Use setMessageProcessors() */
60      void setTransformers(List<Transformer> transformers);
61  
62      /** @deprecated Use setResponseMessageProcessors() */
63      void setResponseTransformers(List<Transformer> responseTransformer);
64  
65      void setName(String name);
66  
67      void setProperty(Object key, Object value);
68      
69      void setProperties(Map<Object, Object> properties);
70  
71      void setTransactionConfig(TransactionConfig transactionConfig);
72  
73      void setDeleteUnacceptedMessages(boolean deleteUnacceptedMessages);
74      
75      void setExchangePattern(MessageExchangePattern mep);
76  
77      void setResponseTimeout(int responseTimeout);
78  
79      void setInitialState(String initialState);
80  
81      void setEncoding(String encoding);
82  
83      void setRegistryId(String registryId);
84  
85      void setMuleContext(MuleContext muleContext);
86  
87      void setRetryPolicyTemplate(RetryPolicyTemplate retryPolicyTemplate);
88  
89      void setMessageProcessors(List <MessageProcessor> messageProcessors);
90  
91      void addMessageProcessor(MessageProcessor messageProcessor);
92  
93      void setResponseMessageProcessors(List <MessageProcessor> responseMessageProcessors);
94  
95      void addResponseMessageProcessor(MessageProcessor responseMessageProcessor);
96  
97      void setDisableTransportTransformer(boolean disableTransportTransformer);
98      
99      void setURIBuilder(URIBuilder URIBuilder);
100 
101     Object clone() throws CloneNotSupportedException;
102 
103 }