org.springframework.integration.ip.tcp
Class SimpleTcpNetInboundGateway
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.gateway.AbstractMessagingGateway
org.springframework.integration.ip.tcp.SimpleTcpNetInboundGateway
- All Implemented Interfaces:
- BeanFactoryAware, BeanNameAware, InitializingBean, Lifecycle, Phased, SmartLifecycle, NamedComponent
public class SimpleTcpNetInboundGateway
- extends AbstractMessagingGateway
Simple implementation of a TCP/IP inbound gateway; uses Socket
and socket reader thread hangs on receive for response; therefore no multiplexing
of incoming messages is supported. Delegates most of its work to a private
subclass of TcpNetReceivingChannelAdapter
, overriding the
processMessage() method.
Consequently, the pool size needs to be large enough to support the maximum
number of concurrent connections expected.
- Since:
- 2.0
- Author:
- Gary Russell
Methods inherited from class org.springframework.integration.gateway.AbstractMessagingGateway |
getComponentType, receive, send, sendAndReceive, sendAndReceiveMessage, setExceptionMapper, setReplyChannel, setReplyTimeout, setRequestChannel, setRequestTimeout, setShouldThrowErrors |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, toString, writeMessageHistory |
mapper
protected SocketMessageMapper mapper
delegate
protected org.springframework.integration.ip.tcp.SimpleTcpNetInboundGateway.WriteCapableTcpNetReceivingChannelAdapter delegate
port
protected int port
messageFormat
protected int messageFormat
poolSize
protected int poolSize
receiveBufferSize
protected int receiveBufferSize
soKeepAlive
protected boolean soKeepAlive
soReceiveBufferSize
protected int soReceiveBufferSize
soSendBufferSize
protected int soSendBufferSize
soTimeout
protected int soTimeout
customSocketReaderClassName
protected String customSocketReaderClassName
customSocketWriterClass
protected Class<NetSocketWriter> customSocketWriterClass
close
protected boolean close
localAddress
protected String localAddress
taskExecutor
protected Executor taskExecutor
SimpleTcpNetInboundGateway
public SimpleTcpNetInboundGateway()
doStart
protected void doStart()
- Description copied from class:
AbstractEndpoint
- Subclasses must implement this method with the start behavior.
This method will be invoked while holding the
AbstractEndpoint.lifecycleLock
.
- Overrides:
doStart
in class AbstractMessagingGateway
doStop
protected void doStop()
- Description copied from class:
AbstractEndpoint
- Subclasses must implement this method with the stop behavior.
This method will be invoked while holding the
AbstractEndpoint.lifecycleLock
.
- Overrides:
doStop
in class AbstractMessagingGateway
onInit
protected void onInit()
throws Exception
- Description copied from class:
IntegrationObjectSupport
- Subclasses may implement this for initialization logic.
- Overrides:
onInit
in class AbstractMessagingGateway
- Throws:
Exception
fromMessage
protected Object fromMessage(Message<?> message)
- Overrides:
fromMessage
in class AbstractMessagingGateway
toMessage
protected Message<?> toMessage(Object object)
- Overrides:
toMessage
in class AbstractMessagingGateway
setPort
public void setPort(int port)
- Parameters:
port
- the port to set
setMessageFormat
public void setMessageFormat(int messageFormat)
- Parameters:
messageFormat
- the messageFormat to set
setPoolSize
public void setPoolSize(int poolSize)
- Parameters:
poolSize
- the poolSize to set
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize)
- Parameters:
receiveBufferSize
- the receiveBufferSize to set
setSoKeepAlive
public void setSoKeepAlive(boolean soKeepAlive)
- Parameters:
soKeepAlive
- the soKeepAlive to set
getPort
public int getPort()
- Returns:
- the port
setSoReceiveBufferSize
public void setSoReceiveBufferSize(int soReceiveBufferSize)
- Parameters:
soReceiveBufferSize
- the soReceiveBufferSize to set
setSoSendBufferSize
public void setSoSendBufferSize(int soSendBufferSize)
- Parameters:
soSendBufferSize
- the soSendBufferSize to set
setSoTimeout
public void setSoTimeout(int soTimeout)
- Parameters:
soTimeout
- the soTimeout to set
setCustomSocketReaderClassName
public void setCustomSocketReaderClassName(String customSocketReaderClassName)
- Parameters:
customSocketReaderClassName
- the customSocketReaderClassName to set
setCustomSocketWriterClassName
public void setCustomSocketWriterClassName(String customSocketWriterClassName)
throws ClassNotFoundException
- Parameters:
customSocketWriterClassName
- the customSocketWriterClassName to set
- Throws:
ClassNotFoundException
setClose
public void setClose(boolean close)
- Parameters:
close
- the close to set
setTaskExecutor
public void setTaskExecutor(Executor taskExecutor)
isListening
public boolean isListening()
setLocalAddress
public void setLocalAddress(String localAddress)
Copyright © 2010. All Rights Reserved.