org.springframework.integration.ip
Class AbstractInternetProtocolReceivingChannelAdapter

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.endpoint.AbstractEndpoint
          extended by org.springframework.integration.endpoint.MessageProducerSupport
              extended by org.springframework.integration.ip.AbstractInternetProtocolReceivingChannelAdapter
All Implemented Interfaces:
java.lang.Runnable, BeanFactoryAware, BeanNameAware, InitializingBean, Lifecycle, Phased, SmartLifecycle, NamedComponent, MessageProducer, TrackableComponent, CommonSocketOptions
Direct Known Subclasses:
UnicastReceivingChannelAdapter

public abstract class AbstractInternetProtocolReceivingChannelAdapter
extends MessageProducerSupport
implements java.lang.Runnable, CommonSocketOptions

Base class for inbound TCP/UDP Channel Adapters.

Since:
2.0

Field Summary
protected  boolean active
           
protected  boolean listening
           
protected  java.lang.String localAddress
           
protected  int poolSize
           
protected  int port
           
protected  int receiveBufferSize
           
protected  int soReceiveBufferSize
           
protected  int soTimeout
           
protected  java.util.concurrent.Executor taskExecutor
           
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
AbstractInternetProtocolReceivingChannelAdapter(int port)
           
 
Method Summary
protected  void checkTaskExecutor(java.lang.String threadName)
          Creates a default task executor if none was supplied.
protected  void doStart()
          Takes no action by default.
protected  void doStop()
          Takes no action by default.
 java.lang.String getLocalAddress()
           
 int getPort()
           
 boolean isListening()
           
 void setLocalAddress(java.lang.String localAddress)
          On a multi-homed system, specifies the ip address of the network interface used to communicate.
 void setPoolSize(int poolSize)
           
 void setReceiveBufferSize(int receiveBufferSize)
           
 void setSoReceiveBufferSize(int soReceiveBufferSize)
           
 void setSoSendBufferSize(int soSendBufferSize)
           
 void setSoTimeout(int soTimeout)
           
 void setTaskExecutor(java.util.concurrent.Executor taskExecutor)
           
 
Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
onInit, sendMessage, setErrorChannel, setOutputChannel, setSendTimeout, setShouldTrack
 
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface org.springframework.integration.context.NamedComponent
getComponentName, getComponentType
 

Field Detail

port

protected final int port

soTimeout

protected volatile int soTimeout

soReceiveBufferSize

protected volatile int soReceiveBufferSize

receiveBufferSize

protected volatile int receiveBufferSize

active

protected volatile boolean active

listening

protected volatile boolean listening

localAddress

protected volatile java.lang.String localAddress

taskExecutor

protected volatile java.util.concurrent.Executor taskExecutor

poolSize

protected volatile int poolSize
Constructor Detail

AbstractInternetProtocolReceivingChannelAdapter

public AbstractInternetProtocolReceivingChannelAdapter(int port)
Method Detail

getPort

public int getPort()
Returns:
The port on which this receiver is listening.

setSoTimeout

public void setSoTimeout(int soTimeout)
Specified by:
setSoTimeout in interface CommonSocketOptions
See Also:
Socket.setSoTimeout(int), DatagramSocket.setSoTimeout(int)

setSoReceiveBufferSize

public void setSoReceiveBufferSize(int soReceiveBufferSize)
Specified by:
setSoReceiveBufferSize in interface CommonSocketOptions
See Also:
Socket.setReceiveBufferSize(int), DatagramSocket.setReceiveBufferSize(int)

setSoSendBufferSize

public void setSoSendBufferSize(int soSendBufferSize)
Specified by:
setSoSendBufferSize in interface CommonSocketOptions
See Also:
Socket.setSendBufferSize(int), DatagramSocket.setSendBufferSize(int)

setReceiveBufferSize

public void setReceiveBufferSize(int receiveBufferSize)

doStart

protected void doStart()
Description copied from class: MessageProducerSupport
Takes no action by default. Subclasses may override this if they need lifecycle-managed behavior.

Overrides:
doStart in class MessageProducerSupport

checkTaskExecutor

protected void checkTaskExecutor(java.lang.String threadName)
Creates a default task executor if none was supplied.

Parameters:
threadName -

doStop

protected void doStop()
Description copied from class: MessageProducerSupport
Takes no action by default. Subclasses may override this if they need lifecycle-managed behavior.

Overrides:
doStop in class MessageProducerSupport

isListening

public boolean isListening()

getLocalAddress

public java.lang.String getLocalAddress()

setLocalAddress

public void setLocalAddress(java.lang.String localAddress)
Description copied from interface: CommonSocketOptions
On a multi-homed system, specifies the ip address of the network interface used to communicate. For inbound adapters and gateways, specifies the interface used to listed for incoming connections. If omitted, the endpoint will listen on all available adapters. For the UDP multicast outbound adapter specifies the interface to which multicast packets will be sent. For UDP unicast and multicast adapters, specifies which interface to which the acknowledgment socket will be bound. Does not apply to TCP outbound adapters and gateways.

Specified by:
setLocalAddress in interface CommonSocketOptions

setPoolSize

public void setPoolSize(int poolSize)

setTaskExecutor

public void setTaskExecutor(java.util.concurrent.Executor taskExecutor)