org.mule.endpoint
Class AbstractEndpointBuilder

java.lang.Object
  extended by org.mule.endpoint.AbstractEndpointBuilder
All Implemented Interfaces:
Cloneable, MuleContextAware, EndpointBuilder
Direct Known Subclasses:
EndpointURIEndpointBuilder

public abstract class AbstractEndpointBuilder
extends Object
implements EndpointBuilder

Abstract endpoint builder used for externalizing the complex creation logic of endpoints out of the endpoint instance itself.
The use of a builder allows i) Endpoints to be configured once and created in a repeatable fashion (global endpoints), ii) Allow for much more extensibility in endpoint creation for transport specific endpoints, streaming endpoints etc.


Field Summary
protected  ConnectionStrategy connectionStrategy
           
protected  Connector connector
           
protected  Integer createConnector
           
protected  Boolean deleteUnacceptedMessages
           
protected  String encoding
           
protected  Filter filter
           
protected  String initialState
           
protected  MuleContext muleContext
           
protected  String name
           
protected  Map properties
           
static String PROPERTY_REMOTE_SYNC
           
static String PROPERTY_REMOTE_SYNC_TIMEOUT
           
protected  String registryId
           
protected  Boolean remoteSync
           
protected  Integer remoteSyncTimeout
           
protected  List responseTransformers
           
protected  EndpointSecurityFilter securityFilter
           
protected  Boolean synchronous
           
protected  TransactionConfig transactionConfig
           
protected  List transformers
           
protected  URIBuilder uriBuilder
           
 
Constructor Summary
AbstractEndpointBuilder()
           
 
Method Summary
 void addTransformer(Transformer transformer)
           
 InboundEndpoint buildInboundEndpoint()
          Constructs inbound endpoints
 OutboundEndpoint buildOutboundEndpoint()
          Constructs outbound endpoints
 Object clone()
           
protected  InboundEndpoint doBuildInboundEndpoint()
           
protected  OutboundEndpoint doBuildOutboundEndpoint()
           
protected static boolean equal(Object a, Object b)
           
 boolean equals(Object obj)
           
static Boolean getBooleanProperty(Map properties, String name, Boolean dflt)
           
protected  ConnectionStrategy getConnectionStrategy(Connector connector)
           
protected  Connector getConnector()
           
protected  ConnectionStrategy getDefaultConnectionStrategy(Connector connector)
           
protected  Connector getDefaultConnector()
           
protected  boolean getDefaultDeleteUnacceptedMessages(Connector connector)
           
protected  String getDefaultEndpointEncoding(Connector connector)
           
protected  Filter getDefaultFilter(Connector connector)
           
protected  List getDefaultInboundTransformers(Connector connector)
           
protected  String getDefaultInitialState(Connector connector)
           
protected  List getDefaultOutboundTransformers(Connector connector)
           
protected  boolean getDefaultRemoteSync(Connector connector)
           
protected  int getDefaultRemoteSyncTimeout(Connector connector)
           
protected  List getDefaultResponseTransformers(Connector connector)
           
protected  EndpointSecurityFilter getDefaultSecurityFilter()
           
protected  boolean getDefaultSynchronous(Connector connector, String protocol)
           
protected  TransactionConfig getDefaultTransactionConfig()
           
protected  boolean getDeleteUnacceptedMessages(Connector connector)
           
 URIBuilder getEndpointBuilder()
           
protected  String getEndpointEncoding(Connector connector)
           
protected  Filter getFilter(Connector connector)
           
protected  List getInboundEndpointResponseTransformers(Connector connector, EndpointURI endpointURI)
           
protected  List getInboundTransformers(Connector connector, EndpointURI endpointURI)
           
protected  String getInitialState(Connector connector)
           
static Integer getIntegerProperty(Map properties, String name, Integer dflt)
           
protected  String getName(EndpointURI endpointURI)
           
protected  List getOutboundEndpointResponseTransformers(Connector connector, EndpointURI endpointURI)
           
protected  List getOutboundTransformers(Connector connector, EndpointURI endpointURI)
           
protected  Map getProperties()
           
protected  boolean getRemoteSync(Connector connector)
           
protected  int getRemoteSyncTimeout(Connector connector)
           
protected  EndpointSecurityFilter getSecurityFilter()
           
protected  boolean getSynchronous(Connector connector, EndpointURI endpointURI)
           
protected  TransactionConfig getTransactionConfig()
           
 int hashCode()
           
 void setConnectionStrategy(ConnectionStrategy connectionStrategy)
           
 void setConnector(Connector connector)
           
 void setCreateConnector(int createConnector)
           
 void setDeleteUnacceptedMessages(boolean deleteUnacceptedMessages)
           
 void setEncoding(String encoding)
           
 void setFilter(Filter filter)
           
 void setInitialState(String initialState)
           
 void setMuleContext(MuleContext muleContext)
           
 void setName(String name)
           
 void setProperties(Map properties)
          NOTE - this appends properties.
protected  void setPropertiesFromProperties(Map properties)
           
 void setProperty(Object key, Object value)
          Sets a property on the endpoint
 void setRegistryId(String registryId)
           
 void setRemoteSync(boolean remoteSync)
           
 void setRemoteSyncTimeout(int remoteSyncTimeout)
           
 void setResponseTransformers(List responseTransformers)
           
 void setSecurityFilter(EndpointSecurityFilter securityFilter)
           
 void setSynchronous(boolean synchronous)
           
 void setTransactionConfig(TransactionConfig transactionConfig)
           
 void setTransformers(List transformers)
           
 void setURIBuilder(URIBuilder URIBuilder)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_REMOTE_SYNC

public static final String PROPERTY_REMOTE_SYNC
See Also:
Constant Field Values

PROPERTY_REMOTE_SYNC_TIMEOUT

public static final String PROPERTY_REMOTE_SYNC_TIMEOUT
See Also:
Constant Field Values

uriBuilder

protected URIBuilder uriBuilder

connector

protected Connector connector

transformers

protected List transformers

responseTransformers

protected List responseTransformers

name

protected String name

properties

protected Map properties

transactionConfig

protected TransactionConfig transactionConfig

filter

protected Filter filter

deleteUnacceptedMessages

protected Boolean deleteUnacceptedMessages

securityFilter

protected EndpointSecurityFilter securityFilter

synchronous

protected Boolean synchronous

remoteSync

protected Boolean remoteSync

remoteSyncTimeout

protected Integer remoteSyncTimeout

initialState

protected String initialState

encoding

protected String encoding

createConnector

protected Integer createConnector

connectionStrategy

protected ConnectionStrategy connectionStrategy

registryId

protected String registryId

muleContext

protected MuleContext muleContext
Constructor Detail

AbstractEndpointBuilder

public AbstractEndpointBuilder()
Method Detail

buildInboundEndpoint

public InboundEndpoint buildInboundEndpoint()
                                     throws EndpointException,
                                            InitialisationException
Description copied from interface: EndpointBuilder
Constructs inbound endpoints

Specified by:
buildInboundEndpoint in interface EndpointBuilder
Returns:
Throws:
EndpointException
InitialisationException

buildOutboundEndpoint

public OutboundEndpoint buildOutboundEndpoint()
                                       throws EndpointException,
                                              InitialisationException
Description copied from interface: EndpointBuilder
Constructs outbound endpoints

Specified by:
buildOutboundEndpoint in interface EndpointBuilder
Returns:
Throws:
EndpointException
InitialisationException

setPropertiesFromProperties

protected void setPropertiesFromProperties(Map properties)

getBooleanProperty

public static Boolean getBooleanProperty(Map properties,
                                         String name,
                                         Boolean dflt)

getIntegerProperty

public static Integer getIntegerProperty(Map properties,
                                         String name,
                                         Integer dflt)

doBuildInboundEndpoint

protected InboundEndpoint doBuildInboundEndpoint()
                                          throws InitialisationException,
                                                 EndpointException
Throws:
InitialisationException
EndpointException

doBuildOutboundEndpoint

protected OutboundEndpoint doBuildOutboundEndpoint()
                                            throws InitialisationException,
                                                   EndpointException
Throws:
InitialisationException
EndpointException

getSynchronous

protected boolean getSynchronous(Connector connector,
                                 EndpointURI endpointURI)

getDefaultSynchronous

protected boolean getDefaultSynchronous(Connector connector,
                                        String protocol)

getConnectionStrategy

protected ConnectionStrategy getConnectionStrategy(Connector connector)

getDefaultConnectionStrategy

protected ConnectionStrategy getDefaultConnectionStrategy(Connector connector)

getTransactionConfig

protected TransactionConfig getTransactionConfig()

getDefaultTransactionConfig

protected TransactionConfig getDefaultTransactionConfig()

getSecurityFilter

protected EndpointSecurityFilter getSecurityFilter()

getDefaultSecurityFilter

protected EndpointSecurityFilter getDefaultSecurityFilter()

getConnector

protected Connector getConnector()
                          throws EndpointException
Throws:
EndpointException

getDefaultConnector

protected Connector getDefaultConnector()
                                 throws EndpointException
Throws:
EndpointException

getName

protected String getName(EndpointURI endpointURI)

getProperties

protected Map getProperties()

getRemoteSync

protected boolean getRemoteSync(Connector connector)

getDefaultRemoteSync

protected boolean getDefaultRemoteSync(Connector connector)

getDeleteUnacceptedMessages

protected boolean getDeleteUnacceptedMessages(Connector connector)

getDefaultDeleteUnacceptedMessages

protected boolean getDefaultDeleteUnacceptedMessages(Connector connector)

getEndpointEncoding

protected String getEndpointEncoding(Connector connector)

getDefaultEndpointEncoding

protected String getDefaultEndpointEncoding(Connector connector)

getFilter

protected Filter getFilter(Connector connector)

getDefaultFilter

protected Filter getDefaultFilter(Connector connector)

getInitialState

protected String getInitialState(Connector connector)

getDefaultInitialState

protected String getDefaultInitialState(Connector connector)

getRemoteSyncTimeout

protected int getRemoteSyncTimeout(Connector connector)

getDefaultRemoteSyncTimeout

protected int getDefaultRemoteSyncTimeout(Connector connector)

getInboundTransformers

protected List getInboundTransformers(Connector connector,
                                      EndpointURI endpointURI)
                               throws TransportFactoryException
Throws:
TransportFactoryException

getDefaultInboundTransformers

protected List getDefaultInboundTransformers(Connector connector)
                                      throws TransportFactoryException
Throws:
TransportFactoryException

getOutboundTransformers

protected List getOutboundTransformers(Connector connector,
                                       EndpointURI endpointURI)
                                throws TransportFactoryException
Throws:
TransportFactoryException

getDefaultOutboundTransformers

protected List getDefaultOutboundTransformers(Connector connector)
                                       throws TransportFactoryException
Throws:
TransportFactoryException

getInboundEndpointResponseTransformers

protected List getInboundEndpointResponseTransformers(Connector connector,
                                                      EndpointURI endpointURI)
                                               throws TransportFactoryException
Throws:
TransportFactoryException

getOutboundEndpointResponseTransformers

protected List getOutboundEndpointResponseTransformers(Connector connector,
                                                       EndpointURI endpointURI)
                                                throws TransportFactoryException
Throws:
TransportFactoryException

getDefaultResponseTransformers

protected List getDefaultResponseTransformers(Connector connector)
                                       throws TransportFactoryException
Throws:
TransportFactoryException

setConnector

public void setConnector(Connector connector)
Specified by:
setConnector in interface EndpointBuilder

addTransformer

public void addTransformer(Transformer transformer)
Specified by:
addTransformer in interface EndpointBuilder

setTransformers

public void setTransformers(List transformers)
Specified by:
setTransformers in interface EndpointBuilder

setResponseTransformers

public void setResponseTransformers(List responseTransformers)
Specified by:
setResponseTransformers in interface EndpointBuilder

setName

public void setName(String name)
Specified by:
setName in interface EndpointBuilder

setProperties

public void setProperties(Map properties)
NOTE - this appends properties.

Specified by:
setProperties in interface EndpointBuilder

setProperty

public void setProperty(Object key,
                        Object value)
Sets a property on the endpoint

Specified by:
setProperty in interface EndpointBuilder
Parameters:
key - the property key
value - the value of the property

setTransactionConfig

public void setTransactionConfig(TransactionConfig transactionConfig)
Specified by:
setTransactionConfig in interface EndpointBuilder

setFilter

public void setFilter(Filter filter)
Specified by:
setFilter in interface EndpointBuilder

setDeleteUnacceptedMessages

public void setDeleteUnacceptedMessages(boolean deleteUnacceptedMessages)
Specified by:
setDeleteUnacceptedMessages in interface EndpointBuilder

setSecurityFilter

public void setSecurityFilter(EndpointSecurityFilter securityFilter)
Specified by:
setSecurityFilter in interface EndpointBuilder

setSynchronous

public void setSynchronous(boolean synchronous)
Specified by:
setSynchronous in interface EndpointBuilder

setRemoteSync

public void setRemoteSync(boolean remoteSync)
Specified by:
setRemoteSync in interface EndpointBuilder

setRemoteSyncTimeout

public void setRemoteSyncTimeout(int remoteSyncTimeout)
Specified by:
setRemoteSyncTimeout in interface EndpointBuilder

setInitialState

public void setInitialState(String initialState)
Specified by:
setInitialState in interface EndpointBuilder

setEncoding

public void setEncoding(String encoding)
Specified by:
setEncoding in interface EndpointBuilder

setCreateConnector

public void setCreateConnector(int createConnector)

setRegistryId

public void setRegistryId(String registryId)
Specified by:
setRegistryId in interface EndpointBuilder

setMuleContext

public void setMuleContext(MuleContext muleContext)
Specified by:
setMuleContext in interface MuleContextAware
Specified by:
setMuleContext in interface EndpointBuilder

setConnectionStrategy

public void setConnectionStrategy(ConnectionStrategy connectionStrategy)
Specified by:
setConnectionStrategy in interface EndpointBuilder

getEndpointBuilder

public URIBuilder getEndpointBuilder()

setURIBuilder

public void setURIBuilder(URIBuilder URIBuilder)
Specified by:
setURIBuilder in interface EndpointBuilder

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

equal

protected static boolean equal(Object a,
                               Object b)

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in interface EndpointBuilder
Overrides:
clone in class Object
Throws:
CloneNotSupportedException


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.