org.mule.transport.tcp
Class TcpMessageDispatcher

java.lang.Object
  extended by org.mule.transport.AbstractTransportMessageHandler
      extended by org.mule.transport.AbstractMessageDispatcher
          extended by org.mule.transport.tcp.TcpMessageDispatcher
All Implemented Interfaces:
Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, MessageProcessor, Connectable, MessageDispatcher
Direct Known Subclasses:
LocalSocketTcpMessageDispatcher

public class TcpMessageDispatcher
extends AbstractMessageDispatcher

Send transformed Mule events over TCP.


Field Summary
 
Fields inherited from class org.mule.transport.AbstractMessageDispatcher
defaultOutboundTransformers, defaultResponseTransformers
 
Fields inherited from class org.mule.transport.AbstractTransportMessageHandler
connected, endpoint, lifecycleManager, logger, muleMessageFactory, retryTemplate
 
Fields inherited from interface org.mule.api.transport.MessageDispatcher
RECEIVE_NO_WAIT, RECEIVE_WAIT_INDEFINITELY
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
TcpMessageDispatcher(OutboundEndpoint endpoint)
           
 
Method Summary
protected  void doConnect()
           
protected  void doDisconnect()
           
protected  void doDispatch(MuleEvent event)
           
protected  void doDispose()
           
protected  MuleMessage doSend(MuleEvent event)
           
protected static Object receiveFromSocket(Socket socket, int timeout, ImmutableEndpoint endpoint)
           
 RetryContext validateConnection(RetryContext retryContext)
          Test whether the connector is able to connect to its resource(s).
 
Methods inherited from class org.mule.transport.AbstractMessageDispatcher
applyOutboundTransformers, applyResponseTransformers, createLifecycleManager, getDispatcherName, getEndpoint, getWorkManager, process, returnResponse, returnResponse
 
Methods inherited from class org.mule.transport.AbstractTransportMessageHandler
activate, connect, connectHandler, createMuleMessage, createMuleMessage, createMuleMessage, createMuleMessageFactory, createNullMuleMessage, disconnect, dispose, disposeAndLogException, doInitialise, doStart, doStartHandler, doStop, getConnectEventId, getConnectionDescription, getConnector, getLifecycleState, initialise, initializeMessageFactory, initializeRetryPolicy, isConnected, isDoThreading, isStarted, isStarting, isStopped, isStopping, passivate, setEndpoint, start, stop, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.transport.MessageDispatcher
activate, createMuleMessage, createMuleMessage, getConnector, passivate, validate
 
Methods inherited from interface org.mule.api.transport.Connectable
connect, disconnect, getConnectionDescription, isConnected
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.api.lifecycle.Startable
start
 
Methods inherited from interface org.mule.api.lifecycle.Stoppable
stop
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 
Methods inherited from interface org.mule.api.lifecycle.LifecycleStateEnabled
getLifecycleState
 

Constructor Detail

TcpMessageDispatcher

public TcpMessageDispatcher(OutboundEndpoint endpoint)
Method Detail

doDispatch

protected void doDispatch(MuleEvent event)
                   throws Exception
Specified by:
doDispatch in class AbstractMessageDispatcher
Throws:
Exception

doSend

protected MuleMessage doSend(MuleEvent event)
                      throws Exception
Specified by:
doSend in class AbstractMessageDispatcher
Throws:
Exception

receiveFromSocket

protected static Object receiveFromSocket(Socket socket,
                                          int timeout,
                                          ImmutableEndpoint endpoint)
                                   throws IOException
Throws:
IOException

doDispose

protected void doDispose()
Overrides:
doDispose in class AbstractTransportMessageHandler

doConnect

protected void doConnect()
                  throws Exception
Overrides:
doConnect in class AbstractTransportMessageHandler
Throws:
Exception

doDisconnect

protected void doDisconnect()
                     throws Exception
Overrides:
doDisconnect in class AbstractTransportMessageHandler
Throws:
Exception

validateConnection

public RetryContext validateConnection(RetryContext retryContext)
Description copied from interface: Connectable
Test whether the connector is able to connect to its resource(s). This will allow a retry policy to go into effect in the case of failure. Implementations must call either: Callers should then check for RetryContext.isOk(). The failure, if any, will be provided via the RetryContext.getLastFailure().

Specified by:
validateConnection in interface Connectable
Overrides:
validateConnection in class AbstractTransportMessageHandler
Returns:
same retry context with status info set and any failures populated


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