org.mule.impl
Class ImmutableMuleEndpoint

java.lang.Object
  extended byorg.mule.impl.ImmutableMuleEndpoint
All Implemented Interfaces:
java.lang.Cloneable, Initialisable, java.io.Serializable, UMOImmutableEndpoint
Direct Known Subclasses:
MuleEndpoint

public class ImmutableMuleEndpoint
extends java.lang.Object
implements UMOImmutableEndpoint

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

Version:
$Revision: 1.6 $
Author:
Ross Mason
See Also:
Serialized Form

Field Summary
protected  UMOConnector connector
          The endpoint used to communicate with the external system
protected  boolean deleteUnacceptedMessages
          determines whether unaccepted filtered events should be removed from the source.
protected  UMOEndpointURI endpointUri
          The endpointUri on which to send or receive information
protected  UMOFilter filter
          event filter for this endpoint
protected  SynchronizedBoolean initialised
          has this endpoint been initialised
protected static Log logger
          logger used by this class
protected  java.lang.String name
          The name for the endpoint
protected  java.util.Map properties
          Any additional properties for the endpoint
protected  UMOEndpointSecurityFilter securityFilter
          The security filter to apply to this endpoint
protected  java.lang.Boolean synchronous
          whether events received by this endpoint should execute in a single thread
protected  UMOTransactionConfig transactionConfig
          The transaction configuration for this endpoint
protected  UMOTransformer transformer
          The transformer used to transform the incoming or outgoing data
protected  java.lang.String type
          Determines whether the endpoint is a receiver or sender or both
 
Fields inherited from interface org.mule.umo.endpoint.UMOImmutableEndpoint
ENDPOINT_TYPE_RECEIVER, ENDPOINT_TYPE_RESPONSE, ENDPOINT_TYPE_SENDER, ENDPOINT_TYPE_SENDER_AND_RECEIVER
 
Constructor Summary
ImmutableMuleEndpoint(java.lang.String endpoint, java.lang.String type)
           
ImmutableMuleEndpoint(java.lang.String name, UMOEndpointURI endpointUri, UMOConnector connector, UMOTransformer transformer, java.lang.String type, java.util.Map properties)
          Default constructor
ImmutableMuleEndpoint(UMOImmutableEndpoint source)
           
 
Method Summary
 boolean canReceive()
          Determines whether this endpoint can be used to receive events
 boolean canSend()
          Determines whether this endpoint can be used to send events
 java.lang.Object clone()
          Make a deep copy of this endpoint
static UMOEndpoint createEndpointFromUri(UMOEndpointURI uri, java.lang.String type)
           
 boolean equals(java.lang.Object o)
           
 UMOConnector getConnector()
          The endpoint that will be used to send the message on.
static UMOEndpoint getEndpointFromUri(java.lang.String uri)
           
static UMOEndpoint getEndpointFromUri(UMOEndpointURI uri)
           
 UMOEndpointURI getEndpointURI()
          This specifes the communication endpointUri.
 UMOFilter getFilter()
          The filter to apply to incoming messages.
 java.lang.String getName()
          The name is the identifier for the endpoint
static UMOEndpoint getOrCreateEndpointForUri(java.lang.String uriIdentifier, java.lang.String type)
           
static UMOEndpoint getOrCreateEndpointForUri(UMOEndpointURI uri, java.lang.String type)
           
 java.util.Map getProperties()
          Returns any properties set on this endpoint
 java.lang.String getProtocol()
          The transport protocol name that the message endpoint communicates over.
 UMOEndpointSecurityFilter getSecurityFilter()
          Returns an UMOEndpointSecurityFilter for this endpoint.
 UMOTransactionConfig getTransactionConfig()
          Returns the transaction configuration for this endpoint
 UMOTransformer getTransformer()
          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).
 java.lang.String getType()
          Determines whether the message endpoint is a sender or receiver or both.
 int hashCode()
           
protected  void initFromDescriptor(UMOImmutableEndpoint source)
           
 void initialise()
           
 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 isReadOnly()
           
 boolean isSynchronous()
          Determines if requests originating from this endpoint should be synchronous i.e.
 boolean isSynchronousExplicitlySet()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static transient Log logger
logger used by this class


connector

protected UMOConnector connector
The endpoint used to communicate with the external system


endpointUri

protected UMOEndpointURI endpointUri
The endpointUri on which to send or receive information


transformer

protected UMOTransformer transformer
The transformer used to transform the incoming or outgoing data


name

protected java.lang.String name
The name for the endpoint


type

protected java.lang.String type
Determines whether the endpoint is a receiver or sender or both


properties

protected java.util.Map properties
Any additional properties for the endpoint


transactionConfig

protected UMOTransactionConfig transactionConfig
The transaction configuration for this endpoint


filter

protected UMOFilter filter
event filter for this endpoint


deleteUnacceptedMessages

protected boolean deleteUnacceptedMessages
determines whether unaccepted filtered events should be removed from the source. If they are not removed its up to the Message receiver to handle recieving the same message again


initialised

protected SynchronizedBoolean initialised
has this endpoint been initialised


securityFilter

protected UMOEndpointSecurityFilter securityFilter
The security filter to apply to this endpoint


synchronous

protected java.lang.Boolean synchronous
whether events received by this endpoint should execute in a single thread

Constructor Detail

ImmutableMuleEndpoint

public ImmutableMuleEndpoint(java.lang.String endpoint,
                             java.lang.String type)
                      throws UMOException

ImmutableMuleEndpoint

public ImmutableMuleEndpoint(java.lang.String name,
                             UMOEndpointURI endpointUri,
                             UMOConnector connector,
                             UMOTransformer transformer,
                             java.lang.String type,
                             java.util.Map properties)
Default constructor


ImmutableMuleEndpoint

public ImmutableMuleEndpoint(UMOImmutableEndpoint source)
Method Detail

initFromDescriptor

protected void initFromDescriptor(UMOImmutableEndpoint source)

getEndpointURI

public UMOEndpointURI getEndpointURI()
Description copied from interface: UMOImmutableEndpoint
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:
getEndpointURI in interface UMOImmutableEndpoint
Returns:
the endpointUri on which the endpoint sends or receives data

getType

public java.lang.String getType()
Description copied from interface: UMOImmutableEndpoint
Determines whether the message endpoint is a sender or receiver or both. The possible values are- The default is 'senderAndReceiver'.

Specified by:
getType in interface UMOImmutableEndpoint
Returns:
the endpoint type

getConnector

public UMOConnector getConnector()
Description copied from interface: UMOImmutableEndpoint
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 UMOImmutableEndpoint
Returns:
the endpoint associated with the endpoint

getName

public java.lang.String getName()
Description copied from interface: UMOImmutableEndpoint
The name is the identifier for the endpoint

Specified by:
getName in interface UMOImmutableEndpoint
Returns:
the endpoint name

getTransformer

public UMOTransformer getTransformer()
Description copied from interface: UMOImmutableEndpoint
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:
getTransformer in interface UMOImmutableEndpoint
Returns:
the transformer to use when receiving or sending data

getProperties

public java.util.Map getProperties()
Description copied from interface: UMOImmutableEndpoint
Returns any properties set on this endpoint

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

clone

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

Specified by:
clone in interface UMOImmutableEndpoint

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface UMOImmutableEndpoint
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 java.lang.String toString()

getProtocol

public java.lang.String getProtocol()
Description copied from interface: UMOImmutableEndpoint
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 UMOImmutableEndpoint
Returns:
the protocol name

canReceive

public boolean canReceive()
Description copied from interface: UMOImmutableEndpoint
Determines whether this endpoint can be used to receive events

Specified by:
canReceive in interface UMOImmutableEndpoint
Returns:
true if it has been configured to receive events, false otherwise

canSend

public boolean canSend()
Description copied from interface: UMOImmutableEndpoint
Determines whether this endpoint can be used to send events

Specified by:
canSend in interface UMOImmutableEndpoint
Returns:
true if it has been configured to send events, false otherwise

getTransactionConfig

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

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

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

getFilter

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

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

createEndpointFromUri

public static UMOEndpoint createEndpointFromUri(UMOEndpointURI uri,
                                                java.lang.String type)
                                         throws UMOException
Throws:
UMOException

getEndpointFromUri

public static UMOEndpoint getEndpointFromUri(java.lang.String uri)

getEndpointFromUri

public static UMOEndpoint getEndpointFromUri(UMOEndpointURI uri)
                                      throws UMOException
Throws:
UMOException

getOrCreateEndpointForUri

public static UMOEndpoint getOrCreateEndpointForUri(java.lang.String uriIdentifier,
                                                    java.lang.String type)
                                             throws UMOException
Throws:
UMOException

getOrCreateEndpointForUri

public static UMOEndpoint getOrCreateEndpointForUri(UMOEndpointURI uri,
                                                    java.lang.String type)
                                             throws UMOException
Throws:
UMOException

isDeleteUnacceptedMessages

public boolean isDeleteUnacceptedMessages()
Description copied from interface: UMOImmutableEndpoint
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 UMOImmutableEndpoint
Returns:
true if message should be deleted, false otherwise

initialise

public void initialise()
                throws InitialisationException
Specified by:
initialise in interface Initialisable
Throws:
InitialisationException

getSecurityFilter

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

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

isSynchronous

public boolean isSynchronous()
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:
isSynchronous in interface UMOImmutableEndpoint
Returns:
whether requests on this endpoint should execute in a single thread. This property is only used when the endpoint is of type 'receiver'

isSynchronousExplicitlySet

public boolean isSynchronousExplicitlySet()


Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.