|
||||||||||
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 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 boolean |
SERVER
|
static String |
TCP
|
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()
|
ConfigurableKeyedObjectPool |
getDispatchers()
|
ExpiryMonitor |
getKeepAliveMonitor()
|
int |
getKeepAliveTimeout()
|
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 |
protected AbstractTcpSocketFactory |
getSocketFactory()
|
int |
getSocketMaxWait()
|
int |
getSocketSoLinger()
|
int |
getSocketsPoolMaxActive()
|
int |
getSocketsPoolMaxIdle()
|
long |
getSocketsPoolMaxWait()
|
int |
getSocketsPoolNumActive()
|
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 |
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 |
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 int DEFAULT_WAIT_TIMEOUT
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 AbstractConnector
InitialisationException
protected 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 AbstractConnector
Exception
protected void doDisconnect() throws Exception
AbstractConnector
doDisconnect
in class AbstractConnector
Exception
protected void doStart() throws MuleException
AbstractConnector
doStart
in class AbstractConnector
MuleException
- if the method failsprotected void doStop() throws MuleException
AbstractConnector
doStop
in class AbstractConnector
MuleException
- if the method failspublic 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 getServerSoTimeout()
public void setServerSoTimeout(int timeout)
public int getSocketMaxWait()
public void setSocketMaxWait(int timeout)
@Deprecated public int getBufferSize()
getSendBufferSize()
or getReceiveBufferSize()
@Deprecated 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)
@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 Connector
isResponseEnabled
in class AbstractConnector
public 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
IOException
public 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 void setDispatcherFactory(MessageDispatcherFactory dispatcherFactory)
Connector
setDispatcherFactory
in interface Connector
setDispatcherFactory
in class AbstractConnector
dispatcherFactory
- The dispatcherFactory to set.public ConfigurableKeyedObjectPool getDispatchers()
public int getSocketsPoolMaxActive()
public int getSocketsPoolMaxIdle()
public int getSocketsPoolNumActive()
public long getSocketsPoolMaxWait()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |