public class TcpNetServerConnectionFactory extends AbstractServerConnectionFactory
TcpNetConnection
s using
a ServerSocket
. Must have a TcpListener
registered.DEFAULT_REPLY_TIMEOUT, lifecycleMonitor
logger
Constructor and Description |
---|
TcpNetServerConnectionFactory(int port)
Listens for incoming connections on the port.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the factory.
|
protected java.net.ServerSocket |
createServerSocket(int port,
int backlog,
java.net.InetAddress whichNic)
Create a new
ServerSocket . |
protected java.net.ServerSocket |
getServerSocket() |
protected TcpSocketFactorySupport |
getTcpSocketFactorySupport() |
void |
run()
If no listener registers, exits.
|
void |
setTcpSocketFactorySupport(TcpSocketFactorySupport tcpSocketFactorySupport) |
afterShutdown, beforeShutdown, getBacklog, getConnection, getLocalAddress, initializeConnection, isListening, isShuttingDown, postProcessServerSocket, setBacklog, setListening, setLocalAddress, start
addConnection, checkActive, closeConnection, doAccept, getApplicationEventPublisher, getDeserializer, getHost, getListener, getMapper, getOpenConnectionIds, getPhase, getPort, getSender, getSerializer, getSoLinger, getSoReceiveBufferSize, getSoSendBufferSize, getSoTimeout, getSoTrafficClass, getTaskExecutor, getTcpSocketSupport, harvestClosedConnections, isActive, isAutoStartup, isLookupHost, isRunning, isSingleUse, isSoKeepAlive, isSoTcpNoDelay, processNioSelections, registerListener, registerSender, setActive, setApplicationEventPublisher, setDeserializer, setInterceptorFactoryChain, setLookupHost, setMapper, setNioHarvestInterval, setSerializer, setSingleUse, setSocketAttributes, setSoKeepAlive, setSoLinger, setSoReceiveBufferSize, setSoSendBufferSize, setSoTcpNoDelay, setSoTimeout, setSoTrafficClass, setTaskExecutor, setTcpSocketSupport, stop, stop, wrapConnection
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getComponentType, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, onInit, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
public TcpNetServerConnectionFactory(int port)
port
- The port.public void run()
AbstractServerConnectionFactory.initializeConnection(TcpConnectionSupport, Socket)
and executes the
connection Runnable.run()
using the task executor.
I/O errors on the server socket/channel are logged and the factory is stopped.protected java.net.ServerSocket createServerSocket(int port, int backlog, java.net.InetAddress whichNic) throws java.io.IOException
ServerSocket
. This default implementation uses the default
ServerSocketFactory
. Override to use some other mechanismport
- The port.backlog
- The server socket backlog.whichNic
- An InetAddress if binding to a specific network interface. Set to
null when configured to bind to all interfaces.java.io.IOException
public void close()
AbstractConnectionFactory
close
in class AbstractConnectionFactory
protected java.net.ServerSocket getServerSocket()
protected TcpSocketFactorySupport getTcpSocketFactorySupport()
public void setTcpSocketFactorySupport(TcpSocketFactorySupport tcpSocketFactorySupport)