Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.transport.tcp
Class TcpConnector

    java.lang.Object
      org.mule.transport.AbstractConnector
          org.mule.transport.tcp.TcpConnector

All Implemented Interfaces:
  EventListener, javax.resource.spi.work.WorkListener, Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, NamedObject, Connectable, Connector

Direct Known Subclasses:
  HttpConnector, PollingTcpConnector, SslConnector

    public class TcpConnector

extends AbstractConnector

`TcpConnector` can bind or sent to a given TCP port on a given host. Other socket-based transports can be built on top of this class by providing the appropriate socket factories and application level protocols as required (see the constructor and the SSL transport for examples).

Field Summary
`static boolean` | `CLIENT`
`static int` | `DEFAULT_BACKLOG`
`static int` | `DEFAULT_BUFFER_SIZE`
`static int` | `DEFAULT_SO_LINGER`
`static int` | `DEFAULT_SOCKET_TIMEOUT`
`static String` | `KEEP_SEND_SOCKET_OPEN_PROPERTY` Property can be set on the endpoint to configure how the socket is managed
`static boolean` | `SERVER`
`static String` | `TCP`

Fields inherited from class org.mule.transport.AbstractConnector
`connected, createMultipleTransactedReceivers, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatchers, initialStateStopped, lifecycleManager, logger, muleContext, muleMessageFactory, name, numberOfConcurrentTransactedReceivers, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, startOnConnect`

Fields inherited from interface org.mule.api.transport.Connector
`INT_VALUE_NOT_SET`

Fields inherited from interface org.mule.api.lifecycle.Disposable
`PHASE_NAME`

Constructor Summary
`TcpConnector(MuleContext context)`

Method Summary
`void` | `configureSocket(boolean client, Socket socket)`
`protected void` | `doConnect()` Template method where any connections should be made for the connector
`protected void` | `doDisconnect()` Template method where any connected resources used by the connector should be disconnected
`protected void` | `doDispose()` Template method to perform any work when destroying the connectoe
`protected 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
`int` | `getBacklog()` Deprecated. should use `getReceiveBacklog()`
`int` | `getBufferSize()` Deprecated. Should use `getSendBufferSize()` or `getReceiveBufferSize()`
`int` | `getClientSoTimeout()`
`ExpiryMonitor` | `getKeepAliveMonitor()`
`int` | `getKeepAliveTimeout()`
`NextMessageExceptionPolicy` | `getNextMessageExceptionPolicy()`
`OutputStream` | `getOutputStream(ImmutableEndpoint endpoint, MuleMessage message)`
`String` | `getProtocol()`
`int` | `getReceiveBacklog()`
`int` | `getReceiveBufferSize()`
`int` | `getSendBufferSize()`
`protected ServerSocket` | `getServerSocket(URI uri)`
`SimpleServerSocketFactory` | `getServerSocketFactory()`
`int` | `getServerSoTimeout()`
`protected Socket` | `getSocket(ImmutableEndpoint endpoint)` Lookup a socket in the list of dispatcher sockets but don't create a new socket
`AbstractTcpSocketFactory` | `getSocketFactory()`
`SocketPoolFactory` | `getSocketPoolFactory()`
`int` | `getSocketSoLinger()`
`TcpProtocol` | `getTcpProtocol()`
`boolean` | `isKeepAlive()`
`boolean` | `isKeepSendSocketOpen()`
`boolean` | `isResponseEnabled()`
`Boolean` | `isReuseAddress()`
`boolean` | `isSendTcpNoDelay()`
`void` | `setBacklog(int backlog)` Deprecated. should use `setReceiveBacklog(int)`
`void` | `setBufferSize(int bufferSize)` Deprecated. Should use `setSendBufferSize(int)` or `setReceiveBufferSize(int)`
`void` | `setClientSoTimeout(int timeout)`
`void` | `setDispatcherFactory(MessageDispatcherFactory dispatcherFactory)` The dispatcher factory is used to create a message dispatcher of the current request
`void` | `setKeepAlive(boolean keepAlive)`
`void` | `setKeepAliveTimeout(int keepAliveTimeout)` Sets the keep alive timeout (in Milliseconds)
`void` | `setKeepSendSocketOpen(boolean keepSendSocketOpen)`
`void` | `setNextMessageExceptionPolicy(NextMessageExceptionPolicy nextMessageExceptionPolicy)` Set the exception policy to be used when trying to receive the next message
`void` | `setReceiveBacklog(int receiveBacklog)`
`void` | `setReceiveBufferSize(int bufferSize)`
`void` | `setReuseAddress(Boolean reuseAddress)` This allows closed sockets to be reused while they are still in TIME_WAIT state
`void` | `setSendBufferSize(int bufferSize)`
`void` | `setSendTcpNoDelay(boolean sendTcpNoDelay)`
`void` | `setServerSocketFactory(SimpleServerSocketFactory serverSocketFactory)`
`void` | `setServerSoTimeout(int timeout)`
`void` | `setSocketFactory(AbstractTcpSocketFactory socketFactory)`
`void` | `setSocketPoolFactory(SocketPoolFactory socketPoolFactory)`
`void` | `setSocketSoLinger(int soLinger)`
`void` | `setTcpProtocol(TcpProtocol tcpProtocol)`
`void` | `setTimeout(int timeout)` Deprecated. The time out should be set explicitly for each

Methods inherited from class org.mule.transport.AbstractConnector
`clearDispatchers, clearRequesters, configureDispatcherPool, connect, createDispatcherMessageProcessor, createMuleMessageFactory, createReceiver, createScheduler, destroyReceiver, disconnect, dispose, disposeReceivers, disposeWorkManagers, doUnregisterListener, exceptionThrown, fireNotification, getConnectEventId, getConnectionDescription, getDefaultExchangePattern, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getInboundExchangePatterns, getLifecycleState, getMaxDispatchersActive, getMaxRequestersActive, getMaxTotalDispatchers, getMuleContext, getMuleMessageFactory, getName, getNumberOfConcurrentTransactedReceivers, getOutboundExchangePatterns, getOutputStream, getReceiver, getReceiverKey, getReceivers, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getReplyToHandler, getRequesterFactory, getRequesterThreadingProfile, getRequesterWorkManager, getRetryPolicyTemplate, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getSupportedProtocols, handleException, handleException, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isCreateMultipleTransactedReceivers, isDisposed, isEnableMessageEvents, isInitialised, isInitialStateStopped, isStarted, isStopped, isValidateConnections, lookupReceiver, registerListener, registerSupportedMetaProtocol, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, setConnected, setCreateMultipleTransactedReceivers, setDispatcherPoolMaxWait, setDispatcherPoolWhenExhaustedAction, setDispatcherThreadingProfile, setDynamicNotification, setInitialStateStopped, setMaxDispatchersActive, setMaxRequestersActive, setName, setNumberOfConcurrentTransactedReceivers, setReceiverThreadingProfile, setRequesterFactory, setRequesterPoolMaxWait, setRequesterPoolWhenExhaustedAction, setRequesterThreadingProfile, setRetryPolicyTemplate, setServiceOverrides, setSessionHandler, setSupportedProtocols, setupDispatchReturn, setupRequestReturn, setValidateConnections, shutdownScheduler, start, startAfterConnect, stop, supportsProtocol, toString, unregisterListener, unregisterSupportedProtocol, updateCachedNotificationHandler, validateConnection, workAccepted, workCompleted, workRejected, workStarted`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### TCP

    public static final String TCP

See Also:
  Constant Field Values

### KEEP_SEND_SOCKET_OPEN_PROPERTY

    public static final String KEEP_SEND_SOCKET_OPEN_PROPERTY

  Property can be set on the endpoint to configure how the socket is managed

  See Also:
    Constant Field Values

### DEFAULT_SOCKET_TIMEOUT

    public static final int DEFAULT_SOCKET_TIMEOUT

See Also:
  Constant Field Values

### DEFAULT_SO_LINGER

    public static final int DEFAULT_SO_LINGER

See Also:
  Constant Field Values

### DEFAULT_BUFFER_SIZE

    public static final int DEFAULT_BUFFER_SIZE

See Also:
  Constant Field Values

### DEFAULT_BACKLOG

    public static final int DEFAULT_BACKLOG

See Also:
  Constant Field Values

### SERVER

    public static final boolean SERVER

See Also:
  Constant Field Values

### CLIENT

    public static final boolean CLIENT

See Also:
  Constant Field Values

Constructor Detail

### TcpConnector

    public TcpConnector(MuleContext context)

Method Detail

### configureSocket

    public void configureSocket(boolean client,
                                Socket socket)
                         throws SocketException

  Throws:
    `SocketException`

### doInitialise

    protected void doInitialise()
                         throws InitialisationException

  Specified by:
    `doInitialise` in class `AbstractConnector`
  Throws:
    `InitialisationException`

### doDispose

    protected void doDispose()

  Description copied from class: `AbstractConnector`
  Template method to perform any work when destroying the connectoe

  Specified by:
    `doDispose` in class `AbstractConnector`

### getSocket

    protected Socket getSocket(ImmutableEndpoint endpoint)
                        throws Exception

  Lookup a socket in the list of dispatcher sockets but don't create a new socket

  Throws:
    `Exception`

### getOutputStream

    public OutputStream getOutputStream(ImmutableEndpoint endpoint,
                                        MuleMessage message)
                                 throws MuleException

  Throws:
    `MuleException`

### doConnect

    protected void doConnect()
                      throws Exception

  Description copied from class: `AbstractConnector`
  Template method where any connections should be made for the connector

  Specified by:
    `doConnect` in class `AbstractConnector`
  Throws:
    `Exception`

### doDisconnect

    protected void doDisconnect()
                         throws Exception

  Description copied from class: `AbstractConnector`
  Template method where any connected resources used by the connector should be disconnected

  Specified by:
    `doDisconnect` in class `AbstractConnector`
  Throws:
    `Exception`

### doStart

    protected void doStart()
                    throws MuleException

  Description copied from class: `AbstractConnector`
  Template method to perform any work when starting the connectoe

  Specified by:
    `doStart` in class `AbstractConnector`
  Throws:
    `MuleException` - if the method fails

### doStop

    protected void doStop()
                   throws MuleException

  Description copied from class: `AbstractConnector`
  Template method to perform any work when stopping the connectoe

  Specified by:
    `doStop` in class `AbstractConnector`
  Throws:
    `MuleException` - if the method fails

### getProtocol

    public String getProtocol()

  Returns:
    the primary protocol name for endpoints of this connector

### isKeepSendSocketOpen

    public boolean isKeepSendSocketOpen()

### setKeepSendSocketOpen

    public void setKeepSendSocketOpen(boolean keepSendSocketOpen)

### setTimeout

    public void setTimeout(int timeout)

  Deprecated. The time out should be set explicitly for each

  A shorthand property setting timeout for both SEND and RECEIVE sockets.

### getClientSoTimeout

    public int getClientSoTimeout()

### setClientSoTimeout

    public void setClientSoTimeout(int timeout)

### getServerSoTimeout

    public int getServerSoTimeout()

### setServerSoTimeout

    public void setServerSoTimeout(int timeout)

### getBufferSize

    public int getBufferSize()

  Deprecated. Should use `getSendBufferSize()` or `getReceiveBufferSize()`

### setBufferSize

    public void setBufferSize(int bufferSize)

  Deprecated. Should use `setSendBufferSize(int)` or `setReceiveBufferSize(int)`

### getSendBufferSize

    public int getSendBufferSize()

### setSendBufferSize

    public void setSendBufferSize(int bufferSize)

### getReceiveBufferSize

    public int getReceiveBufferSize()

### setReceiveBufferSize

    public void setReceiveBufferSize(int bufferSize)

### getReceiveBacklog

    public int getReceiveBacklog()

### setReceiveBacklog

    public void setReceiveBacklog(int receiveBacklog)

### getSocketSoLinger

    public int getSocketSoLinger()

### setSocketSoLinger

    public void setSocketSoLinger(int soLinger)

### getBacklog

    public int getBacklog()

  Deprecated. should use `getReceiveBacklog()`

### setBacklog

    public void setBacklog(int backlog)

  Deprecated. should use `setReceiveBacklog(int)`

  Parameters:
    `backlog` -

### getTcpProtocol

    public TcpProtocol getTcpProtocol()

### setTcpProtocol

    public void setTcpProtocol(TcpProtocol tcpProtocol)

### isResponseEnabled

    public boolean isResponseEnabled()

  Specified by:
    `isResponseEnabled` in interface `Connector`
  Overrides:
    `isResponseEnabled` in class `AbstractConnector`

### isKeepAlive

    public boolean isKeepAlive()

### setKeepAlive

    public void setKeepAlive(boolean keepAlive)

### isSendTcpNoDelay

    public boolean isSendTcpNoDelay()

### setSendTcpNoDelay

    public void setSendTcpNoDelay(boolean sendTcpNoDelay)

### setSocketFactory

    public void setSocketFactory(AbstractTcpSocketFactory socketFactory)

### getSocketFactory

    public AbstractTcpSocketFactory getSocketFactory()

### getServerSocketFactory

    public SimpleServerSocketFactory getServerSocketFactory()

### setServerSocketFactory

    public void setServerSocketFactory(SimpleServerSocketFactory serverSocketFactory)

### getServerSocket

    protected ServerSocket getServerSocket(URI uri)
                                    throws IOException

  Throws:
    `IOException`

### isReuseAddress

    public Boolean isReuseAddress()

  Returns:
    true if the server socket sets SO_REUSEADDRESS before opening

### setReuseAddress

    public void setReuseAddress(Boolean reuseAddress)

  This allows closed sockets to be reused while they are still in TIME_WAIT state

  Parameters:
    `reuseAddress` - Whether the server socket sets SO_REUSEADDRESS before opening

### getKeepAliveMonitor

    public ExpiryMonitor getKeepAliveMonitor()

### getKeepAliveTimeout

    public int getKeepAliveTimeout()

  Returns:
    keep alive timeout in Milliseconds

### setKeepAliveTimeout

    public void setKeepAliveTimeout(int keepAliveTimeout)

  Sets the keep alive timeout (in Milliseconds)

### getNextMessageExceptionPolicy

    public NextMessageExceptionPolicy getNextMessageExceptionPolicy()

  Returns:
    the exception policy to be used when trying to receive the next message

### setNextMessageExceptionPolicy

    public void setNextMessageExceptionPolicy(NextMessageExceptionPolicy nextMessageExceptionPolicy)

  Set the exception policy to be used when trying to receive the next message

  Parameters:
    `nextMessageExceptionPolicy` - the exception policy to be used

### setDispatcherFactory

    public void setDispatcherFactory(MessageDispatcherFactory dispatcherFactory)

  Description copied from interface: `Connector`
  The dispatcher factory is used to create a message dispatcher of the current request

  Specified by:
    `setDispatcherFactory` in interface `Connector`
  Overrides:
    `setDispatcherFactory` in class `AbstractConnector`
  Parameters:
    `dispatcherFactory` - The dispatcherFactory to set.

### getSocketPoolFactory

    public SocketPoolFactory getSocketPoolFactory()

### setSocketPoolFactory

    public void setSocketPoolFactory(SocketPoolFactory socketPoolFactory)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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