org.mule.tck.testmodels.mule
Class TestConnector

java.lang.Object
  extended byorg.mule.providers.AbstractConnector
      extended byorg.mule.tck.testmodels.mule.TestConnector
All Implemented Interfaces:
Disposable, ExceptionListener, Initialisable, UMOConnectable, UMOConnector

public class TestConnector
extends AbstractConnector

TestConnector us a mock connector

Version:
$Revision: 3798 $
Author:
Ross Mason

Nested Class Summary
 class TestConnector.DummyMessageAdapter
           
 
Field Summary
 
Fields inherited from class org.mule.providers.AbstractConnector
connected, connecting, createDispatcherPerRequest, createMultipleTransactedReceivers, defaultInboundTransformer, defaultOutboundTransformer, defaultResponseTransformer, dispatcherFactory, dispatchers, disposed, disposing, exceptionListener, initialised, logger, name, receivers, serverSide, sessionHandler, started, startOnConnect
 
Fields inherited from interface org.mule.umo.provider.UMOConnector
INT_VALUE_NOT_SET
 
Constructor Summary
TestConnector()
           
 
Method Summary
 UMOMessageReceiver createReceiver(UMOComponent component, UMOEndpoint endpoint)
           
 void destroyReceiver(UMOMessageReceiver receiver, UMOEndpoint endpoint)
           
protected  void doDispose()
          Template method to perform any work when destroying the connectoe
 void doInitialise()
           
protected  void doStart()
          Template method to perform any work when starting the connectoe
protected  void doStop()
          Template method to perform any work when stopping the connectoe
 UMOMessageDispatcher getDispatcher(UMOImmutableEndpoint endpoint)
          The connector can pool dispatchers based on their endpointUri or can ingnore the endpointUri altogether and use a ThreadLocal or always create new.
 UMOMessageAdapter getMessageAdapter(Object message)
          Gets a UMOMessageAdapter from the connector for the given message (data)
 String getProtocol()
           
 UMOStreamMessageAdapter getStreamMessageAdapter(InputStream in, OutputStream out)
          Gets a UMOStreamMessageAdapter from the connector for the given message.
 
Methods inherited from class org.mule.providers.AbstractConnector
checkDisposed, connect, createDispatcher, disconnect, dispose, disposeDispatchers, disposeReceivers, doConnect, doDisconnect, exceptionThrown, fireNotification, getConnectEventId, getConnectionDescription, getConnectionStrategy, getDefaultInboundTransformer, getDefaultOutboundTransformer, getDefaultResponseTransformer, getDispatcher, getDispatcherFactory, getDispatchers, getDispatcherThreadingProfile, getExceptionListener, getName, getReceiver, getReceiver, getReceiverKey, getReceivers, getReceivers, getReceiverThreadingProfile, getReplyToHandler, getSessionHandler, getSupportedProtocols, handleException, handleWorkException, initialise, isConnected, isCreateDispatcherPerRequest, isCreateMultipleTransactedReceivers, isDisposed, isDisposing, isEnableMessageEvents, isRemoteSyncEnabled, isServerSide, isStarted, isUseSingleDispatcherThreadPool, isUseSingleReceiverThreadPool, lookupDispatcher, lookupReceiver, registerListener, registerSupportedProtocol, registerSupportedProtocolWithotPrefix, setConnectionStrategy, setCreateDispatcherPerRequest, setCreateMultipleTransactedReceivers, setDefaultInboundTransformer, setDefaultOutboundTransformer, setDefaultResponseTransformer, setDispatcherFactory, setDispatcherThreadingProfile, setEnableMessageEvents, setExceptionListener, setName, setReceiverThreadingProfile, setServerSide, setSessionHandler, setSupportedProtocols, setUseSingleDispatcherThreadPool, setUseSingleReceiverThreadPool, startConnector, stopConnector, supportsProtocol, unregisterListener, unregisterSupportedProtocol, workAccepted, workCompleted, workRejected, workStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestConnector

public TestConnector()
Method Detail

getDispatcher

public UMOMessageDispatcher getDispatcher(UMOImmutableEndpoint 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.

Specified by:
getDispatcher in interface UMOConnector
Overrides:
getDispatcher in class AbstractConnector
Parameters:
endpoint - the endpoint 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

doDispose

protected void doDispose()
Description copied from class: AbstractConnector
Template method to perform any work when destroying the connectoe

Overrides:
doDispose in class AbstractConnector

doInitialise

public void doInitialise()
                  throws InitialisationException
Overrides:
doInitialise in class AbstractConnector
Throws:
InitialisationException

getProtocol

public String getProtocol()
Specified by:
getProtocol in interface UMOConnector
Specified by:
getProtocol in class AbstractConnector

doStart

protected void doStart()
                throws UMOException
Description copied from class: AbstractConnector
Template method to perform any work when starting the connectoe

Overrides:
doStart in class AbstractConnector
Throws:
UMOException - if the method fails

doStop

protected void doStop()
               throws UMOException
Description copied from class: AbstractConnector
Template method to perform any work when stopping the connectoe

Overrides:
doStop in class AbstractConnector
Throws:
UMOException - if the method fails

getMessageAdapter

public UMOMessageAdapter getMessageAdapter(Object message)
                                    throws MessagingException
Description copied from interface: UMOConnector
Gets a UMOMessageAdapter from the connector for the given message (data)

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

getStreamMessageAdapter

public UMOStreamMessageAdapter getStreamMessageAdapter(InputStream in,
                                                       OutputStream out)
                                                throws MessagingException
Description copied from interface: UMOConnector
Gets a UMOStreamMessageAdapter from the connector for the given message. This Adapter will correctly handle data streaming for this type of connector

Parameters:
in - the input stream to read the data from
out - the outputStream to write data to. This can be null.
Returns:
the UMOStreamMessageAdapter for the endpoint
Throws:
MessagingException - if the message parameter is not supported
See Also:
UMOStreamMessageAdapter

createReceiver

public UMOMessageReceiver createReceiver(UMOComponent component,
                                         UMOEndpoint endpoint)
                                  throws Exception
Specified by:
createReceiver in class AbstractConnector
Throws:
Exception

destroyReceiver

public void destroyReceiver(UMOMessageReceiver receiver,
                            UMOEndpoint endpoint)
                     throws Exception
Overrides:
destroyReceiver in class AbstractConnector
Throws:
Exception


Copyright © 2003-2006 MuleSource Inc.. All Rights Reserved.