public class TcpRequesterConnection extends AbstractSocketConnection implements RequesterConnection
RequesterConnection for establishing TCP connections.| Modifier and Type | Field and Description |
|---|---|
protected TcpProtocol |
protocol
|
connectionSettings, LOGGER, wasDisconnected| Constructor and Description |
|---|
TcpRequesterConnection(SocketConnectionSettings connectionSettings,
SocketConnectionSettings localAddressSettings,
TcpProtocol protocol,
TcpClientSocketProperties socketProperties,
SimpleSocketFactory socketFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Establish a connection ready to be used.
|
void |
doDisconnect()
Template method that does the concrete disconnection for the socket
|
TcpClient |
getClient()
Returns a new instance of
SocketClient particular to this connection. |
protected InetSocketAddress |
getSocketAddress(SocketConnectionSettings connectionSettings,
boolean failOnUnresolvedHost)
Creates an
InetSocketAddress with the host and port information. |
void |
initialise()
Injection of the
ObjectSerializer is needed for TcpProtocol |
org.mule.runtime.api.connection.ConnectionValidationResult |
validate()
Validates socket's connection
|
disconnectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisconnectprotected final TcpProtocol protocol
public TcpRequesterConnection(SocketConnectionSettings connectionSettings, SocketConnectionSettings localAddressSettings, TcpProtocol protocol, TcpClientSocketProperties socketProperties, SimpleSocketFactory socketFactory) throws org.mule.runtime.api.connection.ConnectionException
org.mule.runtime.api.connection.ConnectionExceptionpublic TcpClient getClient()
SocketClient particular to this connection.getClient in interface RequesterConnectionSocketClient that can SocketClient.read() and SocketClient#write(Object) through the
socket.public void doDisconnect()
AbstractSocketConnectiondoDisconnect in class AbstractSocketConnectionpublic void connect()
throws org.mule.runtime.api.connection.ConnectionException
connect in interface SocketConnectionorg.mule.runtime.api.connection.ConnectionException - if the connection couldn't be establishedpublic org.mule.runtime.api.connection.ConnectionValidationResult validate()
validate in interface SocketConnectionpublic void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
ObjectSerializer is needed for TcpProtocolinitialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionprotected InetSocketAddress getSocketAddress(SocketConnectionSettings connectionSettings, boolean failOnUnresolvedHost) throws org.mule.runtime.api.connection.ConnectionException
InetSocketAddress with the host and port information.failOnUnresolvedHost - whether a UnresolvableHostException should be thrown if the address couldn't be resolved.InetSocketAddress configured with the host and port receivedorg.mule.runtime.api.connection.ConnectionExceptionCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.