|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.providers.AbstractConnector
org.mule.providers.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 int |
DEFAULT_BACKLOG
|
static int |
DEFAULT_BUFFER_SIZE
|
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 |
Fields inherited from interface org.mule.umo.provider.UMOConnector |
---|
INT_VALUE_NOT_SET |
Constructor Summary | |
---|---|
TcpConnector()
|
Method Summary | |
---|---|
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() |
OutputStream |
getOutputStream(UMOImmutableEndpoint endpoint,
UMOMessage message)
Will get the output stream for this type of transport. |
String |
getProtocol()
|
int |
getReceiveBacklog()
|
int |
getReceiveBufferSize()
|
int |
getReceiveTimeout()
|
int |
getSendBufferSize()
|
int |
getSendSocketLinger()
|
int |
getSendTimeout()
|
protected ServerSocket |
getServerSocket(URI uri)
|
SimpleServerSocketFactory |
getServerSocketFactory()
|
protected Socket |
getSocket(UMOImmutableEndpoint endpoint)
Lookup a socket in the list of dispatcher sockets but don't create a new socket |
protected PooledSocketFactory |
getSocketFactory()
|
TcpProtocol |
getTcpProtocol()
|
String |
getTcpProtocolClassName()
|
boolean |
isKeepAlive()
|
boolean |
isKeepSendSocketOpen()
|
boolean |
isRemoteSyncEnabled()
|
Boolean |
isReuseAddress()
|
boolean |
isSendTcpNoDelay()
|
boolean |
isValidateConnections()
Should the connection be checked before sending data? |
void |
setBacklog(int backlog)
Deprecated. should use setReceiveBacklog(int) |
void |
setBufferSize(int bufferSize)
Deprecated. Should use setSendBufferSize(int) or setReceiveBufferSize(int) |
void |
setKeepAlive(boolean keepAlive)
|
void |
setKeepSendSocketOpen(boolean keepSendSocketOpen)
|
void |
setReceiveBacklog(int receiveBacklog)
|
void |
setReceiveBufferSize(int bufferSize)
|
void |
setReceiveTimeout(int timeout)
|
void |
setReuseAddress(Boolean reuseAddress)
This allows closed sockets to be reused while they are still in TIME_WAIT state |
void |
setSendBufferSize(int bufferSize)
|
void |
setSendSocketLinger(int soLinger)
|
void |
setSendTcpNoDelay(boolean sendTcpNoDelay)
|
void |
setSendTimeout(int timeout)
|
void |
setServerSocketFactory(SimpleServerSocketFactory serverSocketFactory)
|
protected void |
setSocketFactory(PooledSocketFactory socketFactory)
|
void |
setTcpProtocol(TcpProtocol tcpProtocol)
|
void |
setTcpProtocolClassName(String protocolClassName)
|
void |
setTimeout(int timeout)
Deprecated. The time out should be set explicitly for each |
void |
setValidateConnections(boolean validateConnections)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String KEEP_SEND_SOCKET_OPEN_PROPERTY
public static final int DEFAULT_SOCKET_TIMEOUT
public static final int DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BACKLOG
Constructor Detail |
---|
public TcpConnector()
Method Detail |
---|
protected void doInitialise() throws InitialisationException
doInitialise
in class AbstractConnector
InitialisationException
protected void doDispose()
AbstractConnector
doDispose
in class AbstractConnector
protected Socket getSocket(UMOImmutableEndpoint endpoint) throws Exception
Exception
public OutputStream getOutputStream(UMOImmutableEndpoint endpoint, UMOMessage message) throws UMOException
AbstractConnector
UnsupportedOperationException
is thrown. Note that the stream MUST release resources on close. For help doing so, see
CallbackOutputStream
.
getOutputStream
in interface UMOConnector
getOutputStream
in class AbstractConnector
endpoint
- the endpoint that releates to this Dispatchermessage
- the current message being processed
UMOException
- in case of any errorprotected 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 UMOException
AbstractConnector
doStart
in class AbstractConnector
UMOException
- if the method failsprotected void doStop() throws UMOException
AbstractConnector
doStop
in class AbstractConnector
UMOException
- if the method failspublic String getProtocol()
public boolean isKeepSendSocketOpen()
public void setKeepSendSocketOpen(boolean keepSendSocketOpen)
public void setTimeout(int timeout)
public int getSendTimeout()
public void setSendTimeout(int timeout)
public int getReceiveTimeout()
public void setReceiveTimeout(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 getSendSocketLinger()
public void setSendSocketLinger(int soLinger)
public int getBacklog()
getReceiveBacklog()
public void setBacklog(int backlog)
setReceiveBacklog(int)
backlog
- public TcpProtocol getTcpProtocol()
public void setTcpProtocol(TcpProtocol tcpProtocol)
public String getTcpProtocolClassName()
public void setTcpProtocolClassName(String protocolClassName)
public boolean isRemoteSyncEnabled()
AbstractConnector
isRemoteSyncEnabled
in interface UMOConnector
isRemoteSyncEnabled
in class AbstractConnector
public boolean isKeepAlive()
public void setKeepAlive(boolean keepAlive)
public boolean isSendTcpNoDelay()
public void setSendTcpNoDelay(boolean sendTcpNoDelay)
protected void setSocketFactory(PooledSocketFactory socketFactory)
protected PooledSocketFactory getSocketFactory()
public SimpleServerSocketFactory getServerSocketFactory()
public void setServerSocketFactory(SimpleServerSocketFactory serverSocketFactory)
protected ServerSocket getServerSocket(URI uri) throws IOException
IOException
public boolean isValidateConnections()
public void setValidateConnections(boolean validateConnections)
validateConnections
- If true, the message adapter opens and closes the socket on intialisation.isValidateConnections()
public Boolean isReuseAddress()
public void setReuseAddress(Boolean reuseAddress)
reuseAddress
- Whether the server socket sets SO_REUSEADDRESS before opening
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |