public abstract class AbstractServerConnectionFactory extends AbstractConnectionFactory implements TcpServerConnectionFactory, org.springframework.scheduling.SchedulingAwareRunnable, org.springframework.integration.context.OrderlyShutdownCapable
DEFAULT_REPLY_TIMEOUT, lifecycleMonitor| Constructor and Description |
|---|
AbstractServerConnectionFactory(int port)
The port on which the factory will listen.
|
| Modifier and Type | Method and Description |
|---|---|
int |
afterShutdown() |
int |
beforeShutdown() |
int |
getBacklog()
The number of sockets in the server connection backlog.
|
TcpConnection |
getConnection()
Not supported because the factory manages multiple connections and this
method cannot discriminate.
|
java.lang.String |
getLocalAddress() |
java.net.SocketAddress |
getServerSocketAddress()
Return the
SocketAddress that the underlying ServerSocket
is bound to. |
protected void |
initializeConnection(TcpConnectionSupport connection,
java.net.Socket socket)
Transfers attributes such as (de)serializer, mapper etc to a new connection.
|
boolean |
isListening() |
boolean |
isLongLived() |
protected boolean |
isShuttingDown() |
protected void |
postProcessServerSocket(java.net.ServerSocket serverSocket) |
protected void |
publishServerExceptionEvent(java.lang.Exception e) |
protected void |
publishServerListeningEvent(int port) |
void |
setBacklog(int backlog)
The number of sockets in the connection backlog.
|
protected void |
setListening(boolean listening) |
void |
setLocalAddress(java.lang.String localAddress)
Used on multi-homed systems to enforce the server to listen
on a specific network address instead of all network adapters.
|
void |
start() |
addConnection, checkActive, closeConnection, delayRead, doAccept, getApplicationEventPublisher, getDelayedReads, getDeserializer, getHost, getLifecycleMonitor, getListener, getMapper, getOpenConnectionIds, getPort, getReadDelay, getSender, getSenders, 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, stop, toString, unregisterSender, wrapConnectionafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskSchedulerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPortpublic AbstractServerConnectionFactory(int port)
port - The port.public boolean isLongLived()
isLongLived in interface org.springframework.scheduling.SchedulingAwareRunnable@Nullable public java.net.SocketAddress getServerSocketAddress()
TcpServerConnectionFactorySocketAddress that the underlying ServerSocket
is bound to.getServerSocketAddress in interface TcpServerConnectionFactorypublic void start()
start in interface org.springframework.context.Lifecyclestart in interface org.springframework.integration.support.management.ManageableLifecyclestart in class AbstractConnectionFactorypublic TcpConnection getConnection()
getConnection in interface ConnectionFactoryprotected void setListening(boolean listening)
listening - the listening to setpublic boolean isListening()
protected boolean isShuttingDown()
protected void initializeConnection(TcpConnectionSupport connection, java.net.Socket socket)
connection - The new connection.socket - The new socket.protected void postProcessServerSocket(java.net.ServerSocket serverSocket)
@Nullable public java.lang.String getLocalAddress()
public void setLocalAddress(java.lang.String localAddress)
localAddress - the ip address of the required adapter.public int getBacklog()
public void setBacklog(int backlog)
backlog - The backlog to set.public int beforeShutdown()
beforeShutdown in interface org.springframework.integration.context.OrderlyShutdownCapablepublic int afterShutdown()
afterShutdown in interface org.springframework.integration.context.OrderlyShutdownCapableprotected void publishServerExceptionEvent(java.lang.Exception e)
protected void publishServerListeningEvent(int port)