org.mule.umo.provider
Interface UMOConnector

All Superinterfaces:
Disposable, Initialisable, Startable, Stoppable
All Known Implementing Classes:
AbstractConnector

public interface UMOConnector
extends Startable, Stoppable, Disposable, Initialisable

UMOConnector is the mechanism used to connect to external systems and protocols in order to send and receive data.

Version:
$Revision: 1.2 $
Author:
Ross Mason

Method Summary
 UMOMessageDispatcher getDispatcher(java.lang.String endpoint)
          The connector can pool dispatchers based on their endpointUri or can ingnore the endpointUri altogether and use a ThreadLocal or always create new.
 UMOMessageDispatcherFactory getDispatcherFactory()
          The dispatcher factory is used to create a message dispatcher of the current request
 UMOExceptionStrategy getExceptionStrategy()
           
 UMOMessageAdapter getMessageAdapter(java.lang.Object message)
          Gets a UMOMessageAdapter for the endpoint for the given message (data)
 java.lang.String getName()
           
 java.lang.String getProtocol()
           
 void handleException(java.lang.Object message, java.lang.Throwable exception)
           
 boolean isDisposed()
           
 boolean isStarted()
           
 UMOMessageReceiver registerListener(UMOComponent component, UMOEndpoint endpoint)
          This creates a UMOMessageReceiver associated with this endpoint and registers it with the endpoint
 void setDispatcherFactory(UMOMessageDispatcherFactory factory)
          The dispatcher factory is used to create a message dispatcher of the current request
 void setExceptionStrategy(UMOExceptionStrategy strategy)
           
 void setName(java.lang.String newName)
           
 void unregisterListener(UMOComponent component, UMOEndpoint endpoint)
           
 
Methods inherited from interface org.mule.umo.lifecycle.Startable
start
 
Methods inherited from interface org.mule.umo.lifecycle.Stoppable
stop
 
Methods inherited from interface org.mule.umo.lifecycle.Disposable
dispose
 
Methods inherited from interface org.mule.umo.lifecycle.Initialisable
initialise
 

Method Detail

registerListener

public UMOMessageReceiver registerListener(UMOComponent component,
                                           UMOEndpoint endpoint)
                                    throws java.lang.Exception
This creates a UMOMessageReceiver associated with this endpoint and registers it with the endpoint

Parameters:
component - the listening component
endpoint - the endpoint contains the listener endpointUri on which to listen on.
Throws:
java.lang.Exception - if the UMOMessageReceiver cannot be created or the Receiver cannot be registered

unregisterListener

public void unregisterListener(UMOComponent component,
                               UMOEndpoint endpoint)
                        throws java.lang.Exception
Parameters:
component - the listening component
endpoint - the associated endpointDescriptor with the listener
Throws:
java.lang.Exception - if the listener cannot be unregistered. If a listener is not associated with the given endpoint this will not throw an exception

isStarted

public boolean isStarted()
Returns:
true if the endpoint is started

isDisposed

public boolean isDisposed()
Returns:
true if the endpoint is alive and well or false if the endpoint is being destroyed

getMessageAdapter

public UMOMessageAdapter getMessageAdapter(java.lang.Object message)
                                    throws MessageException
Gets a UMOMessageAdapter for the endpoint for the given message (data)

Parameters:
message - the data with which to initialise the UMOMessageAdapter
Returns:
the UMOMessageAdapter for the endpoint
Throws:
MessageException - if the message parameter is not supported
See Also:
UMOMessageAdapter

getName

public java.lang.String getName()
Returns:
the name associated with the endpoint

setName

public void setName(java.lang.String newName)
Parameters:
newName - the name to associate with the endpoint

getProtocol

public java.lang.String getProtocol()
Returns:
the protocol name for the endpoint

getDispatcher

public UMOMessageDispatcher getDispatcher(java.lang.String endpoint)
                                   throws UMOException
The connector can pool dispatchers based on their endpointUri or can ingnore the endpointUri altogether and use a ThreadLocal or always create new.

Parameters:
endpoint - the endpointUri that can be used to key cached dispatchers
Returns:
the component associated with the endpointUri If there is no component for the current thread one will be created
Throws:
UMOException - if creation of a component fails

setExceptionStrategy

public void setExceptionStrategy(UMOExceptionStrategy strategy)
Parameters:
strategy - the exception strategy to use with this endpoint
See Also:
UMOExceptionStrategy

getExceptionStrategy

public UMOExceptionStrategy getExceptionStrategy()
Returns:
the Exception stategy used by the endpoint
See Also:
UMOExceptionStrategy

handleException

public void handleException(java.lang.Object message,
                            java.lang.Throwable exception)
Parameters:
message - the object that was being processed when the exception occurred
exception - the exception that was caught

setDispatcherFactory

public void setDispatcherFactory(UMOMessageDispatcherFactory factory)
The dispatcher factory is used to create a message dispatcher of the current request

Parameters:
factory - the factory to use when a dispatcher request is madr

getDispatcherFactory

public UMOMessageDispatcherFactory getDispatcherFactory()
The dispatcher factory is used to create a message dispatcher of the current request

Returns:
the factory to use when a dispatcher request is madr


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