public class TcpConnector
extends org.mule.transport.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).| Modifier and Type | Field and Description |
|---|---|
static boolean |
CLIENT |
static int |
DEFAULT_BACKLOG |
static int |
DEFAULT_BUFFER_SIZE |
static int |
DEFAULT_SO_LINGER |
static int |
DEFAULT_SOCKET_TIMEOUT |
static int |
DEFAULT_WAIT_TIMEOUT |
static String |
KEEP_SEND_SOCKET_OPEN_PROPERTY
Property can be set on the endpoint to configure how the socket is managed
|
static String |
SEND_TCP_NO_DELAY_SYSTEM_PROPERTY |
static boolean |
SERVER |
static String |
TCP |
connecting, createMultipleTransactedReceivers, DEFAULT_CONTEXT_START_TIMEOUT, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatcherPoolFactory, dispatchers, initialStateStopped, lifecycleManager, logger, MULE_CONTEXT_START_TIMEOUT_SYSTEM_PROPERTY, muleContext, muleMessageFactory, name, numberOfConcurrentTransactedReceivers, PROPERTY_POLLING_FREQUENCY, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, startOnConnect| Constructor and Description |
|---|
TcpConnector(org.mule.api.MuleContext context) |
| Modifier and Type | Method and Description |
|---|---|
void |
configureSocket(boolean client,
Socket socket) |
protected void |
doConnect() |
protected void |
doDisconnect() |
protected void |
doDispose() |
protected void |
doInitialise() |
protected void |
doStart() |
protected void |
doStop() |
int |
getBacklog()
Deprecated.
should use
getReceiveBacklog() |
int |
getBufferSize()
Deprecated.
Should use
getSendBufferSize() or getReceiveBufferSize() |
int |
getClientSoTimeout() |
int |
getConnectionTimeout() |
org.mule.transport.ConfigurableKeyedObjectPool |
getDispatchers() |
org.mule.util.monitor.ExpiryMonitor |
getKeepAliveMonitor() |
int |
getKeepAliveTimeout() |
OutputStream |
getOutputStream(org.mule.api.endpoint.ImmutableEndpoint endpoint,
org.mule.api.MuleMessage message) |
String |
getProtocol() |
int |
getReceiveBacklog() |
int |
getReceiveBufferSize() |
int |
getSendBufferSize() |
protected ServerSocket |
getServerSocket(URI uri) |
SimpleServerSocketFactory |
getServerSocketFactory() |
int |
getServerSoTimeout() |
protected Socket |
getSocket(org.mule.api.endpoint.ImmutableEndpoint endpoint)
Lookup a socket in the list of dispatcher sockets but don't create a new
socket
|
protected AbstractTcpSocketFactory |
getSocketFactory() |
int |
getSocketMaxWait() |
int |
getSocketSoLinger() |
int |
getSocketsPoolMaxActive() |
int |
getSocketsPoolMaxIdle() |
long |
getSocketsPoolMaxWait() |
int |
getSocketsPoolNumActive() |
TcpProtocol |
getTcpProtocol() |
Boolean |
isFailOnUnresolvedHost() |
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 |
setConnectionTimeout(int timeout) |
void |
setDispatcherFactory(org.mule.api.transport.MessageDispatcherFactory dispatcherFactory) |
void |
setFailOnUnresolvedHost(Boolean failOnUnresolvedHost) |
void |
setKeepAlive(boolean keepAlive) |
void |
setKeepAliveTimeout(int keepAliveTimeout)
Sets the keep alive timeout (in Milliseconds)
|
void |
setKeepSendSocketOpen(boolean keepSendSocketOpen) |
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) |
protected void |
setSocketFactory(AbstractTcpSocketFactory socketFactory) |
void |
setSocketMaxWait(int timeout) |
void |
setSocketSoLinger(int soLinger) |
void |
setTcpProtocol(TcpProtocol tcpProtocol) |
void |
setTimeout(int timeout)
Deprecated.
The time out should be set explicitly for each
|
borrowDispatcher, clearDispatchers, clearRequesters, configureDispatcherPool, connect, connectConnectorAndReceivers, createDefaultRedeliveryPolicy, createDispatcherMessageProcessor, createMuleMessageFactory, createOperationResource, createReceiver, createScheduler, destroyReceiver, disconnect, dispose, disposeReceivers, disposeWorkManagers, doUnregisterListener, fireNotification, fireNotification, getCanonicalURI, getConnectEventId, getConnectionDescription, getDefaultExchangePattern, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherPoolFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getInboundExchangePatterns, getLifecycleState, getMaxDispatchersActive, getMaxRequestersActive, getMaxTotalDispatchers, getMuleContext, getMuleMessageFactory, getName, getNumberOfConcurrentTransactedReceivers, getOperationResourceFactory, getOutboundExchangePatterns, getOutputStream, getReceiver, getReceiverKey, getReceivers, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getReplyToHandler, getRequesterFactory, getRequesterThreadingProfile, getRequesterWorkManager, getRetryPolicyTemplate, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getSupportedProtocols, getTransactionalResource, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isConnecting, isCreateMultipleTransactedReceivers, isDisposed, isEnableMessageEvents, isEnableMessageEvents, isInitialised, isInitialStateStopped, isStarted, isStarting, isStopped, isStopping, isValidateConnections, lookupReceiver, registerListener, registerSupportedMetaProtocol, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, returnDispatcher, setConnected, setConnecting, setCreateMultipleTransactedReceivers, setDispatcherPoolFactory, 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, workStartedpublic static final String TCP
public static final String SEND_TCP_NO_DELAY_SYSTEM_PROPERTY
public static final String KEEP_SEND_SOCKET_OPEN_PROPERTY
public static final int DEFAULT_SOCKET_TIMEOUT
public static final int DEFAULT_SO_LINGER
public static final int DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BACKLOG
public static final int DEFAULT_WAIT_TIMEOUT
public static final boolean SERVER
public static final boolean CLIENT
public void configureSocket(boolean client,
Socket socket)
throws SocketException
SocketExceptionprotected void doInitialise()
throws org.mule.api.lifecycle.InitialisationException
doInitialise in class org.mule.transport.AbstractConnectororg.mule.api.lifecycle.InitialisationExceptionprotected void doDispose()
doDispose in class org.mule.transport.AbstractConnectorprotected Socket getSocket(org.mule.api.endpoint.ImmutableEndpoint endpoint) throws Exception
Exceptionpublic OutputStream getOutputStream(org.mule.api.endpoint.ImmutableEndpoint endpoint, org.mule.api.MuleMessage message) throws org.mule.api.MuleException
org.mule.api.MuleExceptionprotected void doConnect()
throws Exception
doConnect in class org.mule.transport.AbstractConnectorExceptionprotected void doDisconnect()
throws Exception
doDisconnect in class org.mule.transport.AbstractConnectorExceptionprotected void doStart()
throws org.mule.api.MuleException
doStart in class org.mule.transport.AbstractConnectororg.mule.api.MuleExceptionprotected void doStop()
throws org.mule.api.MuleException
doStop in class org.mule.transport.AbstractConnectororg.mule.api.MuleExceptionpublic String getProtocol()
public boolean isKeepSendSocketOpen()
public void setKeepSendSocketOpen(boolean keepSendSocketOpen)
@Deprecated public void setTimeout(int timeout)
public int getClientSoTimeout()
public void setClientSoTimeout(int timeout)
public int getConnectionTimeout()
public void setConnectionTimeout(int timeout)
public int getServerSoTimeout()
public void setServerSoTimeout(int timeout)
public int getSocketMaxWait()
public void setSocketMaxWait(int timeout)
@Deprecated public int getBufferSize()
@Deprecated public void setBufferSize(int bufferSize)
public int getSendBufferSize()
public void setSendBufferSize(int bufferSize)
public int getReceiveBufferSize()
public void setReceiveBufferSize(int bufferSize)
public int getReceiveBacklog()
public void setReceiveBacklog(int receiveBacklog)
public int getSocketSoLinger()
public void setSocketSoLinger(int soLinger)
@Deprecated public int getBacklog()
getReceiveBacklog()@Deprecated public void setBacklog(int backlog)
setReceiveBacklog(int)backlog - public TcpProtocol getTcpProtocol()
public void setTcpProtocol(TcpProtocol tcpProtocol)
public boolean isResponseEnabled()
isResponseEnabled in interface org.mule.api.transport.ConnectorisResponseEnabled in class org.mule.transport.AbstractConnectorpublic boolean isKeepAlive()
public void setKeepAlive(boolean keepAlive)
public boolean isSendTcpNoDelay()
public void setSendTcpNoDelay(boolean sendTcpNoDelay)
protected void setSocketFactory(AbstractTcpSocketFactory socketFactory)
protected AbstractTcpSocketFactory getSocketFactory()
public SimpleServerSocketFactory getServerSocketFactory()
public void setServerSocketFactory(SimpleServerSocketFactory serverSocketFactory)
protected ServerSocket getServerSocket(URI uri) throws IOException
IOExceptionpublic Boolean isReuseAddress()
public void setReuseAddress(Boolean reuseAddress)
reuseAddress - Whether the server socket sets SO_REUSEADDRESS before openingpublic org.mule.util.monitor.ExpiryMonitor getKeepAliveMonitor()
public int getKeepAliveTimeout()
public void setKeepAliveTimeout(int keepAliveTimeout)
public void setDispatcherFactory(org.mule.api.transport.MessageDispatcherFactory dispatcherFactory)
setDispatcherFactory in interface org.mule.api.transport.ConnectorsetDispatcherFactory in class org.mule.transport.AbstractConnectorpublic org.mule.transport.ConfigurableKeyedObjectPool getDispatchers()
public int getSocketsPoolMaxActive()
public int getSocketsPoolMaxIdle()
public int getSocketsPoolNumActive()
public long getSocketsPoolMaxWait()
public Boolean isFailOnUnresolvedHost()
public void setFailOnUnresolvedHost(Boolean failOnUnresolvedHost)
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.