|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory
org.springframework.integration.ip.tcp.connection.TcpNetServerConnectionFactory
public class TcpNetServerConnectionFactory
Implements a server connection factory that produces TcpNetConnection
s using
a ServerSocket
. Must have a TcpListener
registered.
Field Summary |
---|
Fields inherited from class org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory |
---|
DEFAULT_REPLY_TIMEOUT, lifecycleMonitor |
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
TcpNetServerConnectionFactory(int port)
Listens for incoming connections on the port. |
Method Summary | |
---|---|
void |
close()
Closes the server. |
protected java.net.ServerSocket |
createServerSocket(int port,
int backlog,
java.net.InetAddress whichNic)
Create a new ServerSocket . |
protected java.net.ServerSocket |
getServerSocket()
|
void |
run()
If no listener registers, exits. |
Methods inherited from class org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory |
---|
getConnection, getLocalAddress, initializeConnection, isListening, setListening, setLocalAddress |
Methods inherited from class org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory |
---|
addConnection, checkActive, doAccept, getDeserializer, getHost, getListener, getMapper, getPhase, getPoolSize, getPort, getSender, getSerializer, getSoLinger, getSoReceiveBufferSize, getSoSendBufferSize, getSoTimeout, getSoTrafficClass, getTaskExecutor, harvestClosedConnections, isActive, isAutoStartup, isLookupHost, isRunning, isSingleUse, isSoKeepAlive, isSoTcpNoDelay, processNioSelections, registerListener, registerSender, setActive, setDeserializer, setInterceptorFactoryChain, setLookupHost, setMapper, setPoolSize, setSerializer, setSingleUse, setSocketAttributes, setSoKeepAlive, setSoLinger, setSoReceiveBufferSize, setSoSendBufferSize, setSoTcpNoDelay, setSoTimeout, setSoTrafficClass, setTaskExecutor, start, stop, stop, wrapConnection |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TcpNetServerConnectionFactory(int port)
port
- The port.Method Detail |
---|
public void run()
AbstractServerConnectionFactory.initializeConnection(TcpConnection, 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 mechanism
port
- 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()
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |