org.mule.impl.endpoint
Class MuleEndpoint

java.lang.Object
  extended byorg.mule.impl.ImmutableMuleEndpoint
      extended byorg.mule.impl.endpoint.MuleEndpoint
All Implemented Interfaces:
Cloneable, Initialisable, Serializable, UMOEndpoint, UMOImmutableEndpoint, UMOMessageDispatching

public class MuleEndpoint
extends ImmutableMuleEndpoint
implements UMOEndpoint

MuleEndpoint 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
static String ALWAYS_CREATE_STRING
           
static String NEVER_CREATE_STRING
           
 
Fields inherited from class org.mule.impl.ImmutableMuleEndpoint
connector, createConnector, deleteUnacceptedMessages, endpointEncoding, endpointUri, filter, initialised, initialState, logger, name, properties, remoteSync, remoteSyncTimeout, responseTransformer, securityFilter, streaming, synchronous, transactionConfig, transformer, type
 
Fields inherited from interface org.mule.umo.endpoint.UMOImmutableEndpoint
ENDPOINT_TYPE_RECEIVER, ENDPOINT_TYPE_RESPONSE, ENDPOINT_TYPE_SENDER, ENDPOINT_TYPE_SENDER_AND_RECEIVER, INITIAL_STATE_STARTED, INITIAL_STATE_STOPPED
 
Fields inherited from interface org.mule.umo.provider.UMOMessageDispatching
RECEIVE_NO_WAIT, RECEIVE_WAIT_INDEFINITELY
 
Constructor Summary
MuleEndpoint()
          Default constructor This is required right now for the Mule digester to set the properties through the classes mutators
MuleEndpoint(String uri, boolean receiver)
           
MuleEndpoint(String name, UMOEndpointURI endpointUri, UMOConnector connector, UMOTransformer transformer, String type, int createConnector, String endpointEncoding, Map props)
           
MuleEndpoint(UMOImmutableEndpoint endpoint)
           
 
Method Summary
 Object clone()
          Make a deep copy of this endpoint
 boolean isReadOnly()
           
 void setConnector(UMOConnector connector)
          The endpoint that will be used to send the message on.
 void setCreateConnector(int action)
          This attribute determines how a connector is obtained for the endpoint.
 void setCreateConnectorAsString(String action)
           
 void setDeleteUnacceptedMessages(boolean delete)
          If a filter is configured on this endpoint, this property will determine if message that are not excepted by the filter are deleted
 void setEncoding(String endpointEncoding)
          Sets the encoding to be used for events received by this endpoint
 void setEndpointURI(UMOEndpointURI endpointUri)
          This specifes the communication endpointUri.
 void setFilter(UMOFilter filter)
          The filter to apply to incoming messages
 void setInitialState(String state)
          Sets the state the endpoint will be loaded in.
 void setName(String name)
           
 void setProperties(Map props)
           
 void setProperty(String key, Object value)
          Sets a property on the endpoint
 void setRemoteSync(boolean value)
          For certain providers that support the notion of a backchannel such as sockets (outputStream) or Jms (ReplyTo) Mule can automatically wait for a response from a backchannel when dispatching over these protocols.
 void setRemoteSyncTimeout(int timeout)
          The timeout value for remoteSync invocations
 void setResponseTransformer(UMOTransformer trans)
          Sets tyhe transformer used when a response is sent back from the endpoint invocation
 void setSecurityFilter(UMOEndpointSecurityFilter filter)
          Sets an UMOEndpointSecurityFilter for this endpoint.
 void setStreaming(boolean stream)
          Determines whether the endpoint should deal with requests as streams
 void setSynchronous(boolean synchronous)
          Determines if requests originating from this endpoint should be synchronous i.e.
 void setTransactionConfig(UMOTransactionConfig config)
          Sets the Transaction configuration for the endpoint
 void setTransformer(UMOTransformer trans)
          The transformer is responsible for transforming data when it is received or sent by the UMO (depending on whether this endpoint is a receiver or not).
 void setType(String type)
          Determines whether the message endpoint is a sender or receiver or both.
 
Methods inherited from class org.mule.impl.ImmutableMuleEndpoint
canReceive, canSend, createEndpointFromUri, dispatch, equals, getConnector, getCreateConnector, getEncoding, getEndpointFromUri, getEndpointFromUri, getEndpointURI, getFilter, getInitialState, getName, getOrCreateEndpointForUri, getOrCreateEndpointForUri, getProperties, getProperty, getProtocol, getRemoteSyncTimeout, getResponseTransformer, getSecurityFilter, getTransactionConfig, getTransformer, getType, hashCode, initFromDescriptor, initialise, isDeleteUnacceptedMessages, isRemoteSync, isStreaming, isSynchronous, isSynchronousSet, receive, send, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.umo.endpoint.UMOEndpoint
getTransactionConfig
 
Methods inherited from interface org.mule.umo.endpoint.UMOImmutableEndpoint
canReceive, canSend, getConnector, getCreateConnector, getEncoding, getEndpointURI, getFilter, getInitialState, getName, getProperties, getProperty, getProtocol, getRemoteSyncTimeout, getResponseTransformer, getSecurityFilter, getTransformer, getType, isDeleteUnacceptedMessages, isRemoteSync, isStreaming, isSynchronous, isSynchronousSet
 
Methods inherited from interface org.mule.umo.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.umo.provider.UMOMessageDispatching
dispatch, receive, send
 

Field Detail

ALWAYS_CREATE_STRING

public static final String ALWAYS_CREATE_STRING
See Also:
Constant Field Values

NEVER_CREATE_STRING

public static final String NEVER_CREATE_STRING
See Also:
Constant Field Values
Constructor Detail

MuleEndpoint

public MuleEndpoint()
Default constructor This is required right now for the Mule digester to set the properties through the classes mutators


MuleEndpoint

public MuleEndpoint(String name,
                    UMOEndpointURI endpointUri,
                    UMOConnector connector,
                    UMOTransformer transformer,
                    String type,
                    int createConnector,
                    String endpointEncoding,
                    Map props)

MuleEndpoint

public MuleEndpoint(UMOImmutableEndpoint endpoint)

MuleEndpoint

public MuleEndpoint(String uri,
                    boolean receiver)
             throws UMOException
Method Detail

clone

public Object clone()
Description copied from interface: UMOImmutableEndpoint
Make a deep copy of this endpoint

Specified by:
clone in interface UMOImmutableEndpoint
Overrides:
clone in class ImmutableMuleEndpoint

setEndpointURI

public void setEndpointURI(UMOEndpointURI endpointUri)
                    throws EndpointException
Description copied from interface: UMOEndpoint
This specifes 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:
setEndpointURI in interface UMOEndpoint
Parameters:
endpointUri - the endpointUri on which the Endpoint sends or receives data
Throws:
EndpointException - thrown if the EndpointUri cannot be processed by the Endpoint

setEncoding

public void setEncoding(String endpointEncoding)
Description copied from interface: UMOEndpoint
Sets the encoding to be used for events received by this endpoint

Specified by:
setEncoding in interface UMOEndpoint
Parameters:
endpointEncoding - the encoding set on the endpoint. If not set the encoding will be taken from the manager config

setType

public void setType(String type)
Description copied from interface: UMOEndpoint
Determines whether the message endpoint is a sender or receiver or both. The possible values are-

Specified by:
setType in interface UMOEndpoint
Parameters:
type - the endpoint type

setConnector

public void setConnector(UMOConnector connector)
Description copied from interface: UMOEndpoint
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:
setConnector in interface UMOEndpoint
Parameters:
connector - the endpoint to associate with the endpoint

setName

public void setName(String name)
Specified by:
setName in interface UMOEndpoint
Parameters:
name - the name to identify the endpoint

setTransformer

public void setTransformer(UMOTransformer trans)
Description copied from interface: UMOEndpoint
The transformer is responsible for transforming data when it is received or sent by the UMO (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 UMO dispatchEvent() or sendEvent() methods are called.

This attribute represents the name of the transformer to use as declared in the transformers section of the configuration file. IF a name for the transformer is not set on the configuration element, it will default to the name of the className attribute minus the package name.

Specified by:
setTransformer in interface UMOEndpoint
Parameters:
trans - the transformer to use when receiving or sending data

setProperties

public void setProperties(Map props)
Specified by:
setProperties in interface UMOEndpoint
Parameters:
props - properties for this endpoint

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface UMOImmutableEndpoint
Overrides:
isReadOnly in class ImmutableMuleEndpoint

setTransactionConfig

public void setTransactionConfig(UMOTransactionConfig config)
Description copied from interface: UMOEndpoint
Sets the Transaction configuration for the endpoint

Specified by:
setTransactionConfig in interface UMOEndpoint
Parameters:
config - the transaction config to use by this endpoint

setFilter

public void setFilter(UMOFilter filter)
Description copied from interface: UMOEndpoint
The filter to apply to incoming messages

Specified by:
setFilter in interface UMOEndpoint
Parameters:
filter - the filter to use

setDeleteUnacceptedMessages

public void setDeleteUnacceptedMessages(boolean delete)
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:
setDeleteUnacceptedMessages in interface UMOEndpoint
Parameters:
delete - if message should be deleted, false otherwise

setSecurityFilter

public void setSecurityFilter(UMOEndpointSecurityFilter filter)
Sets an UMOEndpointSecurityFilter for this endpoint. If a filter is set all traffice via this endpoint with be subject to authentication.

Specified by:
setSecurityFilter in interface UMOEndpoint
Parameters:
filter - the UMOSecurityFilter responsible for authenticating message flow via this endpoint.
See Also:
UMOEndpointSecurityFilter

setSynchronous

public void setSynchronous(boolean synchronous)
Determines if requests originating from this endpoint should be synchronous i.e. execute in a single thread and possibly return an result. This property is only used when the endpoint is of type 'receiver'.

Specified by:
setSynchronous in interface UMOEndpoint
Parameters:
synchronous - whether requests on this endpoint should execute in a single thread. This property is only used when the endpoint is of type 'receiver'

setCreateConnector

public void setCreateConnector(int action)
Description copied from interface: UMOEndpoint
This attribute determines how a connector is obtained for the endpoint. The options are - GET_OR_CREATE_CONNECTOR = 0: create a connector for the endpoint if one isn't already register (default) ALWAYS_CREATE_CONNECTOR = 1: Always create a new connector of each endpoint NEVER_CREATE_CONNECTOR = 2: Throw an exception if there is not connector with a matching protocol for this endpoint

Specified by:
setCreateConnector in interface UMOEndpoint
Parameters:
action -

setCreateConnectorAsString

public void setCreateConnectorAsString(String action)

setRemoteSync

public void setRemoteSync(boolean value)
For certain providers that support the notion of a backchannel such as sockets (outputStream) or Jms (ReplyTo) Mule can automatically wait for a response from a backchannel when dispatching over these protocols. This is different for synchronous as synchronous behavior only applies to in

Specified by:
setRemoteSync in interface UMOEndpoint
Parameters:
value - whether the endpoint should perfrom sync receives

setRemoteSyncTimeout

public void setRemoteSyncTimeout(int timeout)
The timeout value for remoteSync invocations

Specified by:
setRemoteSyncTimeout in interface UMOEndpoint
Parameters:
timeout - the timeout in milliseconds

setInitialState

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

Specified by:
setInitialState in interface UMOEndpoint
Parameters:
state -

setResponseTransformer

public void setResponseTransformer(UMOTransformer trans)
Description copied from interface: UMOEndpoint
Sets tyhe transformer used when a response is sent back from the endpoint invocation

Specified by:
setResponseTransformer in interface UMOEndpoint
Parameters:
trans - the transformer to use

setStreaming

public void setStreaming(boolean stream)
Determines whether the endpoint should deal with requests as streams

Specified by:
setStreaming in interface UMOEndpoint
Parameters:
stream - true if the request should be streamed

setProperty

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

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


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