public abstract class AbstractClientConnectionFactory extends AbstractConnectionFactory
DEFAULT_REPLY_TIMEOUT, lifecycleMonitor
EXPRESSION_PARSER, logger
Constructor and Description |
---|
AbstractClientConnectionFactory(java.lang.String host,
int port)
Constructs a factory that will established connections to the host and port.
|
Modifier and Type | Method and Description |
---|---|
protected TcpConnectionSupport |
buildNewConnection() |
void |
enableManualListenerRegistration()
Set whether to automatically (default) or manually add a
TcpListener to the
connections created by this factory. |
void |
forceClose(TcpConnection connection)
Force close the connection and null the field if it's
a shared connection.
|
TcpConnectionSupport |
getConnection()
Obtains a connection - if
AbstractConnectionFactory.setSingleUse(boolean) was called with
true, a new connection is returned; otherwise a single connection is
reused for all requests while the connection remains open. |
protected TcpConnectionSupport |
getTheConnection() |
protected void |
initializeConnection(TcpConnectionSupport connection,
java.net.Socket socket)
Transfers attributes such as (de)serializers, singleUse etc to a new connection.
|
protected TcpConnectionSupport |
obtainConnection() |
protected TcpConnectionSupport |
obtainNewConnection() |
protected TcpConnectionSupport |
obtainSharedConnection() |
protected void |
setTheConnection(TcpConnectionSupport theConnection) |
addConnection, checkActive, closeConnection, delayRead, doAccept, getApplicationEventPublisher, getDelayedReads, getDeserializer, getHost, getListener, getMapper, getOpenConnectionIds, getPort, getReadDelay, getSender, getSerializer, getSoLinger, getSoReceiveBufferSize, getSoSendBufferSize, getSoTimeout, getSoTrafficClass, getSslHandshakeTimeout, getTaskExecutor, getTcpSocketSupport, harvestClosedConnections, isActive, isLookupHost, isRunning, isSingleUse, isSoKeepAlive, isSoTcpNoDelay, onInit, processNioSelections, registerListener, registerSender, setActive, setApplicationEventPublisher, setDeserializer, setHost, setInterceptorFactoryChain, setLeaveOpen, setLookupHost, setMapper, setNioHarvestInterval, setPort, setReadDelay, setSerializer, setSingleUse, setSocketAttributes, setSoKeepAlive, setSoLinger, setSoReceiveBufferSize, setSoSendBufferSize, setSoTcpNoDelay, setSoTimeout, setSoTrafficClass, setSslHandshakeTimeout, setTaskExecutor, setTcpSocketSupport, start, stop, toString, wrapConnection
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler
public AbstractClientConnectionFactory(java.lang.String host, int port)
host
- The host.port
- The port.public void enableManualListenerRegistration()
TcpListener
to the
connections created by this factory. By default, the factory automatically configures
the listener. When manual registration is in place, incoming messages will be delayed
until the listener is registered.public TcpConnectionSupport getConnection() throws java.lang.Exception
AbstractConnectionFactory.setSingleUse(boolean)
was called with
true, a new connection is returned; otherwise a single connection is
reused for all requests while the connection remains open.java.lang.Exception
protected TcpConnectionSupport obtainConnection() throws java.lang.Exception
java.lang.Exception
protected final TcpConnectionSupport obtainSharedConnection() throws java.lang.InterruptedException
java.lang.InterruptedException
protected final TcpConnectionSupport obtainNewConnection() throws java.lang.Exception
java.lang.Exception
protected TcpConnectionSupport buildNewConnection() throws java.lang.Exception
java.lang.Exception
protected void initializeConnection(TcpConnectionSupport connection, java.net.Socket socket)
connection
- The new connection.socket
- The new socket.protected void setTheConnection(TcpConnectionSupport theConnection)
theConnection
- the theConnection to setprotected TcpConnectionSupport getTheConnection()
public void forceClose(TcpConnection connection)
connection
- The connection.