|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.transport.AbstractConnector
org.mule.transport.tcp.TcpConnector
public class TcpConnector
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TCP
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 boolean SERVER
public static final boolean CLIENT
| Constructor Detail |
|---|
public TcpConnector(MuleContext context)
| Method Detail |
|---|
public void configureSocket(boolean client,
Socket socket)
throws SocketException
SocketException
protected void doInitialise()
throws InitialisationException
doInitialise in class AbstractConnectorInitialisationExceptionprotected void doDispose()
AbstractConnector
doDispose in class AbstractConnector
protected Socket getSocket(ImmutableEndpoint endpoint)
throws Exception
Exception
public OutputStream getOutputStream(ImmutableEndpoint endpoint,
MuleMessage message)
throws MuleException
MuleException
protected void doConnect()
throws Exception
AbstractConnector
doConnect in class AbstractConnectorException
protected void doDisconnect()
throws Exception
AbstractConnector
doDisconnect in class AbstractConnectorException
protected void doStart()
throws MuleException
AbstractConnector
doStart in class AbstractConnectorMuleException - if the method fails
protected void doStop()
throws MuleException
AbstractConnector
doStop in class AbstractConnectorMuleException - if the method failspublic String getProtocol()
public boolean isKeepSendSocketOpen()
public void setKeepSendSocketOpen(boolean keepSendSocketOpen)
public void setTimeout(int timeout)
public int getClientSoTimeout()
public void setClientSoTimeout(int timeout)
public int getServerSoTimeout()
public void setServerSoTimeout(int timeout)
public int getBufferSize()
getSendBufferSize() or getReceiveBufferSize()
public void setBufferSize(int bufferSize)
setSendBufferSize(int) or setReceiveBufferSize(int)
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)
public int getBacklog()
getReceiveBacklog()
public void setBacklog(int backlog)
setReceiveBacklog(int)
backlog - public TcpProtocol getTcpProtocol()
public void setTcpProtocol(TcpProtocol tcpProtocol)
public boolean isResponseEnabled()
isResponseEnabled in interface ConnectorisResponseEnabled in class AbstractConnectorpublic boolean isKeepAlive()
public void setKeepAlive(boolean keepAlive)
public boolean isSendTcpNoDelay()
public void setSendTcpNoDelay(boolean sendTcpNoDelay)
public void setSocketFactory(AbstractTcpSocketFactory socketFactory)
public 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 ExpiryMonitor getKeepAliveMonitor()
public int getKeepAliveTimeout()
public void setKeepAliveTimeout(int keepAliveTimeout)
public NextMessageExceptionPolicy getNextMessageExceptionPolicy()
public void setNextMessageExceptionPolicy(NextMessageExceptionPolicy nextMessageExceptionPolicy)
nextMessageExceptionPolicy - the exception policy to be usedpublic void setDispatcherFactory(MessageDispatcherFactory dispatcherFactory)
Connector
setDispatcherFactory in interface ConnectorsetDispatcherFactory in class AbstractConnectordispatcherFactory - The dispatcherFactory to set.public SocketPoolFactory getSocketPoolFactory()
public void setSocketPoolFactory(SocketPoolFactory socketPoolFactory)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||