public class ThreadAffinityClientConnectionFactory extends AbstractClientConnectionFactory
releaseConnection().DEFAULT_REPLY_TIMEOUT, lifecycleMonitor| Constructor and Description |
|---|
ThreadAffinityClientConnectionFactory(AbstractClientConnectionFactory connectionFactory) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
closeConnection(java.lang.String connectionId)
Close a connection with the specified connection id.
|
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.
|
java.lang.String |
getApplicationContextId() |
org.springframework.context.ApplicationEventPublisher |
getApplicationEventPublisher() |
java.lang.String |
getComponentName() |
java.lang.String |
getComponentType() |
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. |
org.springframework.core.convert.ConversionService |
getConversionService() |
org.springframework.core.serializer.Deserializer<?> |
getDeserializer() |
org.springframework.expression.Expression |
getExpression() |
java.lang.String |
getHost() |
TcpListener |
getListener() |
TcpMessageMapper |
getMapper() |
java.util.List<java.lang.String> |
getOpenConnectionIds()
Returns a list of (currently) open
TcpConnection connection ids; allows,
for example, broadcast operations to all open connections. |
int |
getPort() |
TcpSender |
getSender() |
org.springframework.core.serializer.Serializer<?> |
getSerializer() |
int |
getSoLinger() |
int |
getSoReceiveBufferSize() |
int |
getSoSendBufferSize() |
int |
getSoTimeout() |
int |
getSoTrafficClass() |
boolean |
isLookupHost() |
boolean |
isRunning() |
boolean |
isSoKeepAlive() |
boolean |
isSoTcpNoDelay() |
void |
registerListener(TcpListener listener)
Registers a TcpListener to receive messages after
the payload has been converted from the input data.
|
void |
registerSender(TcpSender sender)
Registers a TcpSender; for server sockets, used to
provide connection information so a sender can be used
to reply to incoming messages.
|
void |
releaseConnection() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setChannelResolver(org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel> channelResolver) |
void |
setComponentName(java.lang.String componentName) |
void |
setDeserializer(org.springframework.core.serializer.Deserializer<?> deserializer) |
void |
setHost(java.lang.String host)
Set the host; requires the factory to be stopped.
|
void |
setInterceptorFactoryChain(TcpConnectionInterceptorFactoryChain interceptorFactoryChain) |
void |
setLookupHost(boolean lookupHost)
If true, DNS reverse lookup is done on the remote ip address.
|
void |
setMapper(TcpMessageMapper mapper) |
void |
setMessageBuilderFactory(org.springframework.integration.support.MessageBuilderFactory messageBuilderFactory) |
void |
setNioHarvestInterval(int nioHarvestInterval)
How often we clean up closed NIO connections if soTimeout is 0.
|
void |
setPort(int port)
Set the port; requires the factory to be stopped.
|
void |
setReadDelay(long readDelay)
The delay (in milliseconds) before retrying a read after the previous attempt
failed due to insufficient threads.
|
void |
setSerializer(org.springframework.core.serializer.Serializer<?> serializer) |
void |
setSoKeepAlive(boolean soKeepAlive) |
void |
setSoLinger(int soLinger) |
void |
setSoReceiveBufferSize(int soReceiveBufferSize) |
void |
setSoSendBufferSize(int soSendBufferSize) |
void |
setSoTcpNoDelay(boolean soTcpNoDelay) |
void |
setSoTimeout(int soTimeout) |
void |
setSoTrafficClass(int soTrafficClass) |
void |
setSslHandshakeTimeout(int sslHandshakeTimeout)
Set the handshake timeout used when waiting for SSL handshake data; only applies
to SSL connections, when using NIO.
|
void |
setTaskExecutor(java.util.concurrent.Executor taskExecutor) |
void |
setTcpSocketSupport(TcpSocketSupport tcpSocketSupport) |
void |
start() |
void |
stop()
Stops the server.
|
java.lang.String |
toString() |
buildNewConnection, getTheConnection, initializeConnection, obtainConnection, obtainNewConnection, obtainSharedConnection, setTheConnectionaddConnection, checkActive, delayRead, doAccept, getDelayedReads, getReadDelay, getSslHandshakeTimeout, getTaskExecutor, getTcpSocketSupport, harvestClosedConnections, isActive, isSingleUse, onInit, processNioSelections, setActive, setLeaveOpen, setSingleUse, setSocketAttributes, wrapConnectionafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getBeanFactory, getChannelResolver, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setBeanName, setConversionService, setPrimaryExpression, setTaskSchedulerpublic ThreadAffinityClientConnectionFactory(AbstractClientConnectionFactory connectionFactory)
public TcpConnectionSupport getConnection() throws java.lang.Exception
AbstractClientConnectionFactoryAbstractConnectionFactory.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.getConnection in interface ConnectionFactorygetConnection in class AbstractClientConnectionFactoryjava.lang.Exceptionpublic void releaseConnection()
public void enableManualListenerRegistration()
AbstractClientConnectionFactoryTcpListener 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.enableManualListenerRegistration in class AbstractClientConnectionFactorypublic java.lang.String getComponentName()
getComponentName in interface org.springframework.integration.support.context.NamedComponentgetComponentName in class org.springframework.integration.context.IntegrationObjectSupportpublic void setComponentName(java.lang.String componentName)
setComponentName in class org.springframework.integration.context.IntegrationObjectSupportpublic void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwaresetApplicationEventPublisher in class AbstractConnectionFactorypublic java.lang.String getComponentType()
getComponentType in interface org.springframework.integration.support.context.NamedComponentgetComponentType in class org.springframework.integration.context.IntegrationObjectSupportpublic void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwaresetBeanFactory in class org.springframework.integration.context.IntegrationObjectSupportpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwaresetApplicationContext in class org.springframework.integration.context.IntegrationObjectSupportorg.springframework.beans.BeansExceptionpublic org.springframework.context.ApplicationEventPublisher getApplicationEventPublisher()
getApplicationEventPublisher in class AbstractConnectionFactorypublic void setChannelResolver(org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel> channelResolver)
setChannelResolver in class org.springframework.integration.context.IntegrationObjectSupportpublic org.springframework.expression.Expression getExpression()
getExpression in interface org.springframework.integration.context.ExpressionCapablegetExpression in class org.springframework.integration.context.IntegrationObjectSupportpublic void forceClose(TcpConnection connection)
AbstractClientConnectionFactoryforceClose in class AbstractClientConnectionFactoryconnection - The connection.public int getSoTimeout()
getSoTimeout in class AbstractConnectionFactorypublic void setSoTimeout(int soTimeout)
setSoTimeout in class AbstractConnectionFactorysoTimeout - the soTimeout to setpublic int getSoReceiveBufferSize()
getSoReceiveBufferSize in class AbstractConnectionFactorypublic void setSoReceiveBufferSize(int soReceiveBufferSize)
setSoReceiveBufferSize in class AbstractConnectionFactorysoReceiveBufferSize - the soReceiveBufferSize to setpublic int getSoSendBufferSize()
getSoSendBufferSize in class AbstractConnectionFactorypublic void setSoSendBufferSize(int soSendBufferSize)
setSoSendBufferSize in class AbstractConnectionFactorysoSendBufferSize - the soSendBufferSize to setpublic boolean isSoTcpNoDelay()
isSoTcpNoDelay in class AbstractConnectionFactorypublic void setSoTcpNoDelay(boolean soTcpNoDelay)
setSoTcpNoDelay in class AbstractConnectionFactorysoTcpNoDelay - the soTcpNoDelay to setpublic int getSoLinger()
getSoLinger in class AbstractConnectionFactorypublic void setSoLinger(int soLinger)
setSoLinger in class AbstractConnectionFactorysoLinger - the soLinger to setpublic boolean isSoKeepAlive()
isSoKeepAlive in class AbstractConnectionFactorypublic void setSoKeepAlive(boolean soKeepAlive)
setSoKeepAlive in class AbstractConnectionFactorysoKeepAlive - the soKeepAlive to setpublic org.springframework.core.convert.ConversionService getConversionService()
getConversionService in class org.springframework.integration.context.IntegrationObjectSupportpublic int getSoTrafficClass()
getSoTrafficClass in class AbstractConnectionFactorypublic void setSoTrafficClass(int soTrafficClass)
setSoTrafficClass in class AbstractConnectionFactorysoTrafficClass - the soTrafficClass to setpublic void setHost(java.lang.String host)
AbstractConnectionFactorysetHost in class AbstractConnectionFactoryhost - the host.public java.lang.String getHost()
getHost in class AbstractConnectionFactorypublic void setPort(int port)
AbstractConnectionFactorysetPort in class AbstractConnectionFactoryport - the port.public java.lang.String getApplicationContextId()
getApplicationContextId in class org.springframework.integration.context.IntegrationObjectSupportpublic int getPort()
getPort in class AbstractConnectionFactorypublic TcpListener getListener()
getListener in class AbstractConnectionFactorypublic TcpSender getSender()
getSender in class AbstractConnectionFactorypublic org.springframework.core.serializer.Serializer<?> getSerializer()
getSerializer in class AbstractConnectionFactorypublic org.springframework.core.serializer.Deserializer<?> getDeserializer()
getDeserializer in class AbstractConnectionFactorypublic TcpMessageMapper getMapper()
getMapper in class AbstractConnectionFactorypublic void registerListener(TcpListener listener)
AbstractConnectionFactoryregisterListener in class AbstractConnectionFactorylistener - the TcpListener.public void setMessageBuilderFactory(org.springframework.integration.support.MessageBuilderFactory messageBuilderFactory)
setMessageBuilderFactory in class org.springframework.integration.context.IntegrationObjectSupportpublic void registerSender(TcpSender sender)
AbstractConnectionFactoryregisterSender in class AbstractConnectionFactorysender - The senderpublic void setTaskExecutor(java.util.concurrent.Executor taskExecutor)
setTaskExecutor in class AbstractConnectionFactorytaskExecutor - the taskExecutor to setpublic void setDeserializer(org.springframework.core.serializer.Deserializer<?> deserializer)
setDeserializer in class AbstractConnectionFactorydeserializer - the deserializer to setpublic void setSerializer(org.springframework.core.serializer.Serializer<?> serializer)
setSerializer in class AbstractConnectionFactoryserializer - the serializer to setpublic void setMapper(TcpMessageMapper mapper)
setMapper in class AbstractConnectionFactorymapper - the mapper to set; defaults to a TcpMessageMapperpublic void setInterceptorFactoryChain(TcpConnectionInterceptorFactoryChain interceptorFactoryChain)
setInterceptorFactoryChain in class AbstractConnectionFactorypublic void setLookupHost(boolean lookupHost)
AbstractConnectionFactorysetLookupHost in class AbstractConnectionFactorylookupHost - the lookupHost to setpublic boolean isLookupHost()
isLookupHost in class AbstractConnectionFactorypublic void setNioHarvestInterval(int nioHarvestInterval)
AbstractConnectionFactorysoTimeout > 0 because the clean up
process is run as part of the timeout handling.
Default 2000 milliseconds.setNioHarvestInterval in class AbstractConnectionFactorynioHarvestInterval - The interval in milliseconds.public void setSslHandshakeTimeout(int sslHandshakeTimeout)
AbstractConnectionFactorysetSslHandshakeTimeout in class AbstractConnectionFactorysslHandshakeTimeout - the timeout.public void setReadDelay(long readDelay)
AbstractConnectionFactorysetReadDelay in class AbstractConnectionFactoryreadDelay - the readDelay to set.public void start()
start in interface org.springframework.context.Lifecyclestart in class AbstractConnectionFactorypublic void stop()
AbstractConnectionFactorystop in interface org.springframework.context.Lifecyclestop in class AbstractConnectionFactorypublic boolean isRunning()
isRunning in interface org.springframework.context.LifecycleisRunning in class AbstractConnectionFactorypublic void setTcpSocketSupport(TcpSocketSupport tcpSocketSupport)
setTcpSocketSupport in class AbstractConnectionFactorypublic java.util.List<java.lang.String> getOpenConnectionIds()
AbstractConnectionFactoryTcpConnection connection ids; allows,
for example, broadcast operations to all open connections.getOpenConnectionIds in class AbstractConnectionFactorypublic boolean closeConnection(java.lang.String connectionId)
AbstractConnectionFactorycloseConnection in class AbstractConnectionFactoryconnectionId - the connection id.public java.lang.String toString()
toString in class AbstractConnectionFactory