org.mule.endpoint
Class AbstractEndpoint

java.lang.Object
  extended by org.mule.endpoint.AbstractEndpoint
All Implemented Interfaces:
Serializable, AnnotatedObject, ImmutableEndpoint, Disposable, NamedObject
Direct Known Subclasses:
DefaultInboundEndpoint, DefaultOutboundEndpoint

public abstract class AbstractEndpoint
extends Object
implements ImmutableEndpoint, Disposable, AnnotatedObject

ImmutableMuleEndpoint describes a Provider in the Mule Server. A endpoint is a grouping of an endpoint, an endpointUri and a transformer.

See Also:
Serialized Form

Field Summary
protected static Log logger
          logger used by this class
static String PROPERTY_PROCESS_SYNCHRONOUSLY
           
protected  RetryPolicyTemplate retryPolicyTemplate
           
 
Fields inherited from interface org.mule.api.endpoint.ImmutableEndpoint
INITIAL_STATE_STARTED, INITIAL_STATE_STOPPED
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
AbstractEndpoint(Connector connector, EndpointURI endpointUri, String name, Map properties, TransactionConfig transactionConfig, boolean deleteUnacceptedMessages, MessageExchangePattern messageExchangePattern, int responseTimeout, String initialState, String endpointEncoding, String endpointBuilderName, MuleContext muleContext, RetryPolicyTemplate retryPolicyTemplate, AbstractRedeliveryPolicy redeliveryPolicy, EndpointMessageProcessorChainFactory messageProcessorsFactory, List<MessageProcessor> messageProcessors, List<MessageProcessor> responseMessageProcessors, boolean disableTransportTransformer, String endpointMimeType)
           
 
Method Summary
protected abstract  MessageProcessor createMessageProcessorChain(FlowConstruct flowContruct)
           
 void dispose()
          A lifecycle method where implementor should free up any resources.
protected static boolean equal(Object a, Object b)
           
 boolean equals(Object obj)
           
 String getAddress()
          This returns the address of the endpoint.
 Object getAnnotation(QName name)
          Gets the value of specified annotation.
 Map<QName,Object> getAnnotations()
          Gets all annotations.
 Connector getConnector()
          The endpoint that will be used to send the message on.
 String getEncoding()
          Decides the encoding to be used for events received by this endpoint
 String getEndpointBuilderName()
          The name of the endpoint builder used to create this endpoint.
 EndpointURI getEndpointURI()
          This specifess the communication endpointUri.
 MessageExchangePattern getExchangePattern()
           
 Filter getFilter()
          The filter to apply to incoming messages.
 String getInitialState()
          Sets the state the endpoint will be loaded in.
 MessageProcessor getMessageProcessorChain(FlowConstruct flowContruct)
           
 List<MessageProcessor> getMessageProcessors()
           
 EndpointMessageProcessorChainFactory getMessageProcessorsFactory()
           
 String getMimeType()
          Return the mime type defined for the endpoint, if any
 MuleContext getMuleContext()
           
 String getName()
          Gets the name of the object
 Map getProperties()
          Returns any properties set on this endpoint
 Object getProperty(Object key)
          Retrieves a property set on the endpoint
 String getProtocol()
          The transport protocol name that the message endpoint communicates over.
 AbstractRedeliveryPolicy getRedeliveryPolicy()
          Return the endpoint's redelivery policy, if any
 List<MessageProcessor> getResponseMessageProcessors()
           
 int getResponseTimeout()
          The timeout value for remoteSync invocations
 List<Transformer> getResponseTransformers()
          Deprecated. use getResponseMessageProcessors()
 RetryPolicyTemplate getRetryPolicyTemplate()
          The retry policy on the endpoint configures how retries are handled.
 EndpointSecurityFilter getSecurityFilter()
          Returns an EndpointSecurityFilter for this endpoint.
 TransactionConfig getTransactionConfig()
          Returns the transaction configuration for this endpoint
 List<Transformer> getTransformers()
          Deprecated. use getMessageProcessors()
 int hashCode()
           
 boolean isDeleteUnacceptedMessages()
          If a filter is configured on this endpoint, this property will determine if message that are not excepted by the filter are deleted
 boolean isDisableTransportTransformer()
           
 boolean isProtocolSupported(String protocol)
           
 boolean isReadOnly()
           
 void setAnnotations(Map<QName,Object> newAnnotations)
          Sets annotations to the object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_PROCESS_SYNCHRONOUSLY

public static final String PROPERTY_PROCESS_SYNCHRONOUSLY
See Also:
Constant Field Values

logger

protected static final Log logger
logger used by this class


retryPolicyTemplate

protected RetryPolicyTemplate retryPolicyTemplate
Constructor Detail

AbstractEndpoint

public AbstractEndpoint(Connector connector,
                        EndpointURI endpointUri,
                        String name,
                        Map properties,
                        TransactionConfig transactionConfig,
                        boolean deleteUnacceptedMessages,
                        MessageExchangePattern messageExchangePattern,
                        int responseTimeout,
                        String initialState,
                        String endpointEncoding,
                        String endpointBuilderName,
                        MuleContext muleContext,
                        RetryPolicyTemplate retryPolicyTemplate,
                        AbstractRedeliveryPolicy redeliveryPolicy,
                        EndpointMessageProcessorChainFactory messageProcessorsFactory,
                        List<MessageProcessor> messageProcessors,
                        List<MessageProcessor> responseMessageProcessors,
                        boolean disableTransportTransformer,
                        String endpointMimeType)
Method Detail

getEndpointURI

public EndpointURI getEndpointURI()
Description copied from interface: ImmutableEndpoint
This specifess the communication endpointUri. This will have a different format depending on the transport protocol being used i.e.

if an endpointUri is not specifed it will be assumed that it will be determined at run-time by the calling application. The endpointUri can be aliteral endpointUri such as an email address or it can be a logical name for an endpointUri as long as it is declared in a message-endpointUri block. When the message-provider is created the endpointUri is first lookup in the endpointUri registry and if nothing is returned the endpointUri value itself is used.

Specified by:
getEndpointURI in interface ImmutableEndpoint
Returns:
the endpointUri on which the endpoint sends or receives data

getAddress

public String getAddress()
Description copied from interface: ImmutableEndpoint
This returns the address of the endpoint. When this contains a template, it may not be a URI

Specified by:
getAddress in interface ImmutableEndpoint
Returns:
the address on which the endpoint sends or receives data

getEncoding

public String getEncoding()
Description copied from interface: ImmutableEndpoint
Decides the encoding to be used for events received by this endpoint

Specified by:
getEncoding in interface ImmutableEndpoint
Returns:
the encoding set on the endpoint or null if no codin has been specified

getMimeType

public String getMimeType()
Description copied from interface: ImmutableEndpoint
Return the mime type defined for the endpoint, if any

Specified by:
getMimeType in interface ImmutableEndpoint

getConnector

public Connector getConnector()
Description copied from interface: ImmutableEndpoint
The endpoint that will be used to send the message on. It is important that the endpointUri and the connection correlate i.e. if your endpointUri is a jms queue your connection must be a JMS endpoint.

Specified by:
getConnector in interface ImmutableEndpoint
Returns:
the endpoint associated with the endpoint

getName

public String getName()
Description copied from interface: NamedObject
Gets the name of the object

Specified by:
getName in interface NamedObject
Returns:
the name of the object

getMessageProcessorsFactory

public EndpointMessageProcessorChainFactory getMessageProcessorsFactory()
Specified by:
getMessageProcessorsFactory in interface ImmutableEndpoint

getMessageProcessors

public List<MessageProcessor> getMessageProcessors()
Specified by:
getMessageProcessors in interface ImmutableEndpoint

getResponseMessageProcessors

public List<MessageProcessor> getResponseMessageProcessors()
Specified by:
getResponseMessageProcessors in interface ImmutableEndpoint

getTransformers

public List<Transformer> getTransformers()
Deprecated. use getMessageProcessors()

Description copied from interface: ImmutableEndpoint
Transformers are responsible for transforming data when it is received or sent by the component (depending on whether this endpoint is a receiver or not). A tranformation for an inbound event can be forced by the user by calling the inbound event.getTransformedMessage(). A tranformation for an outbound event is called or when the Service dispatchEvent() or sendEvent() methods are called. If an endpoint has no transformers an empty list is returned.

Specified by:
getTransformers in interface ImmutableEndpoint
Returns:
the transformers to use when receiving or sending data

getProperties

public Map getProperties()
Description copied from interface: ImmutableEndpoint
Returns any properties set on this endpoint

Specified by:
getProperties in interface ImmutableEndpoint
Returns:
a map of properties for this endpoint

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface ImmutableEndpoint
Returns:
true if this endpoint is read-only and none of it's properties can change. Global endpoints should be read-only so that unexpected behaviour is avoided.

toString

public String toString()
Overrides:
toString in class Object

getProtocol

public String getProtocol()
Description copied from interface: ImmutableEndpoint
The transport protocol name that the message endpoint communicates over. i.e. jms, sms, smtp etc. The protocol must match that of the associated endpoint

Specified by:
getProtocol in interface ImmutableEndpoint
Returns:
the protocol name

getTransactionConfig

public TransactionConfig getTransactionConfig()
Description copied from interface: ImmutableEndpoint
Returns the transaction configuration for this endpoint

Specified by:
getTransactionConfig in interface ImmutableEndpoint
Returns:
the transaction configuration for this endpoint or null if the endpoint is not transactional

equal

protected static boolean equal(Object a,
                               Object b)

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getFilter

public Filter getFilter()
Description copied from interface: ImmutableEndpoint
The filter to apply to incoming messages. Only applies when the endpoint endpointUri is a receiver

Specified by:
getFilter in interface ImmutableEndpoint
Returns:
the Filter to use or null if one is not set

isDeleteUnacceptedMessages

public boolean isDeleteUnacceptedMessages()
Description copied from interface: ImmutableEndpoint
If a filter is configured on this endpoint, this property will determine if message that are not excepted by the filter are deleted

Specified by:
isDeleteUnacceptedMessages in interface ImmutableEndpoint
Returns:
true if message should be deleted, false otherwise

getSecurityFilter

public EndpointSecurityFilter getSecurityFilter()
Returns an EndpointSecurityFilter for this endpoint. If one is not set, there will be no authentication on events sent via this endpoint

Specified by:
getSecurityFilter in interface ImmutableEndpoint
Returns:
EndpointSecurityFilter responsible for authenticating message flow via this endpoint.
See Also:
EndpointSecurityFilter

getExchangePattern

public MessageExchangePattern getExchangePattern()
Specified by:
getExchangePattern in interface ImmutableEndpoint

getResponseTimeout

public int getResponseTimeout()
The timeout value for remoteSync invocations

Specified by:
getResponseTimeout in interface ImmutableEndpoint
Returns:
the timeout in milliseconds

getInitialState

public String getInitialState()
Sets the state the endpoint will be loaded in. The States are 'stopped' and 'started' (default)

Specified by:
getInitialState in interface ImmutableEndpoint
Returns:
the endpoint starting state

getResponseTransformers

public List<Transformer> getResponseTransformers()
Deprecated. use getResponseMessageProcessors()

Description copied from interface: ImmutableEndpoint
The transformers used when a response is returned from invoking this endpoint. If an endpoint has no response transformers an empty list is returned.

Specified by:
getResponseTransformers in interface ImmutableEndpoint
Returns:
the transformer to use when receiving the response data

getProperty

public Object getProperty(Object key)
Description copied from interface: ImmutableEndpoint
Retrieves a property set on the endpoint

Specified by:
getProperty in interface ImmutableEndpoint
Parameters:
key - the name of the property
Returns:
the property value or null if it does not exist

getMuleContext

public MuleContext getMuleContext()
Specified by:
getMuleContext in interface ImmutableEndpoint

getRetryPolicyTemplate

public RetryPolicyTemplate getRetryPolicyTemplate()
Description copied from interface: ImmutableEndpoint
The retry policy on the endpoint configures how retries are handled. The behaviour is slightly different for inbound and outbound endpoints. For inbound endpoints the Retry Policy determines how the connection to the underlying transport will be managed if the connection is lost. For outbound endpoints, the Retry Policy will attempt to retry dispatching, sending and receiving an event

Specified by:
getRetryPolicyTemplate in interface ImmutableEndpoint
Returns:
the Policy factory to use when retrying a connection or dispatching an event

getRedeliveryPolicy

public AbstractRedeliveryPolicy getRedeliveryPolicy()
Description copied from interface: ImmutableEndpoint
Return the endpoint's redelivery policy, if any

Specified by:
getRedeliveryPolicy in interface ImmutableEndpoint

getEndpointBuilderName

public String getEndpointBuilderName()
Description copied from interface: ImmutableEndpoint
The name of the endpoint builder used to create this endpoint. May be used to an endpoints builder for example to recreate endpoints for deserialized events.

Specified by:
getEndpointBuilderName in interface ImmutableEndpoint

isProtocolSupported

public boolean isProtocolSupported(String protocol)
Specified by:
isProtocolSupported in interface ImmutableEndpoint

isDisableTransportTransformer

public boolean isDisableTransportTransformer()
Specified by:
isDisableTransportTransformer in interface ImmutableEndpoint

dispose

public void dispose()
Description copied from interface: Disposable
A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

Specified by:
dispose in interface Disposable

getMessageProcessorChain

public MessageProcessor getMessageProcessorChain(FlowConstruct flowContruct)
                                          throws MuleException
Throws:
MuleException

getAnnotation

public final Object getAnnotation(QName name)
Description copied from interface: AnnotatedObject
Gets the value of specified annotation.

Specified by:
getAnnotation in interface AnnotatedObject
Returns:
the value of specified annotation

getAnnotations

public final Map<QName,Object> getAnnotations()
Description copied from interface: AnnotatedObject
Gets all annotations.

Specified by:
getAnnotations in interface AnnotatedObject
Returns:
all annotation

setAnnotations

public final void setAnnotations(Map<QName,Object> newAnnotations)
Description copied from interface: AnnotatedObject
Sets annotations to the object.

Specified by:
setAnnotations in interface AnnotatedObject

createMessageProcessorChain

protected abstract MessageProcessor createMessageProcessorChain(FlowConstruct flowContruct)
                                                         throws MuleException
Throws:
MuleException


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.