Class AbstractInternetProtocolReceivingChannelAdapter
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.ip.AbstractInternetProtocolReceivingChannelAdapter
- All Implemented Interfaces:
java.lang.Runnable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.beans.factory.SmartInitializingSingleton,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationEventPublisherAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,org.springframework.integration.context.ExpressionCapable,org.springframework.integration.core.MessageProducer,org.springframework.integration.IntegrationPattern,CommonSocketOptions,org.springframework.integration.support.context.NamedComponent,org.springframework.integration.support.management.ManageableLifecycle,org.springframework.integration.support.management.ManageableSmartLifecycle,org.springframework.integration.support.management.TrackableComponent,org.springframework.scheduling.SchedulingAwareRunnable
- Direct Known Subclasses:
UnicastReceivingChannelAdapter
public abstract class AbstractInternetProtocolReceivingChannelAdapter extends org.springframework.integration.endpoint.MessageProducerSupport implements org.springframework.context.ApplicationEventPublisherAware, org.springframework.scheduling.SchedulingAwareRunnable, CommonSocketOptions
Base class for inbound TCP/UDP Channel Adapters.
- Since:
- 2.0
-
Field Summary
Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleCondition, lifecycleLock -
Constructor Summary
Constructors Constructor Description AbstractInternetProtocolReceivingChannelAdapter(int port) -
Method Summary
Modifier and Type Method Description protected voidcheckTaskExecutor(java.lang.String threadName)Creates a default task executor if none was supplied.protected voiddoStart()Protected by lifecycleLockprotected voiddoStop()protected org.springframework.context.ApplicationEventPublishergetApplicationEventPublisher()java.lang.StringgetLocalAddress()intgetPort()intgetReceiveBufferSize()intgetSoReceiveBufferSize()intgetSoTimeout()java.util.concurrent.ExecutorgetTaskExecutor()booleanisListening()voidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)voidsetListening(boolean listening)voidsetLocalAddress(java.lang.String localAddress)On a multi-homed system, specifies the ip address of the network interface used to communicate.voidsetPoolSize(int poolSize)voidsetReceiveBufferSize(int receiveBufferSize)voidsetSoReceiveBufferSize(int soReceiveBufferSize)voidsetSoTimeout(int soTimeout)voidsetTaskExecutor(java.util.concurrent.Executor taskExecutor)Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, onInit, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisherMethods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
destroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, 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, setTaskScheduler, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.ip.CommonSocketOptions
setSoSendBufferSize
-
Constructor Details
-
AbstractInternetProtocolReceivingChannelAdapter
public AbstractInternetProtocolReceivingChannelAdapter(int port)
-
-
Method Details
-
getPort
public int getPort()- Returns:
- The port on which this receiver is listening.
-
setSoTimeout
public void setSoTimeout(int soTimeout)- Specified by:
setSoTimeoutin interfaceCommonSocketOptions- Parameters:
soTimeout- The timeout.- See Also:
Socket.setSoTimeout(int),DatagramSocket.setSoTimeout(int)
-
getSoTimeout
public int getSoTimeout()- Returns:
- the soTimeout
-
setSoReceiveBufferSize
public void setSoReceiveBufferSize(int soReceiveBufferSize)- Specified by:
setSoReceiveBufferSizein interfaceCommonSocketOptions- Parameters:
soReceiveBufferSize- The receive buffer size.- See Also:
Socket.setReceiveBufferSize(int),DatagramSocket.setReceiveBufferSize(int)
-
getSoReceiveBufferSize
public int getSoReceiveBufferSize()- Returns:
- the soReceiveBufferSize
-
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize) -
getReceiveBufferSize
public int getReceiveBufferSize()- Returns:
- the receiveBufferSize
-
isListening
public boolean isListening() -
setListening
public void setListening(boolean listening)- Parameters:
listening- the listening to set
-
getLocalAddress
public java.lang.String getLocalAddress() -
setLocalAddress
public void setLocalAddress(java.lang.String localAddress)Description copied from interface:CommonSocketOptionsOn 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:
setLocalAddressin interfaceCommonSocketOptions- Parameters:
localAddress- The local address.
-
setPoolSize
public void setPoolSize(int poolSize) -
setTaskExecutor
public void setTaskExecutor(java.util.concurrent.Executor taskExecutor) -
getTaskExecutor
public java.util.concurrent.Executor getTaskExecutor()- Returns:
- the taskExecutor
-
getApplicationEventPublisher
protected org.springframework.context.ApplicationEventPublisher getApplicationEventPublisher() -
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)- Specified by:
setApplicationEventPublisherin interfaceorg.springframework.context.ApplicationEventPublisherAware
-
doStart
protected void doStart()Protected by lifecycleLock- Overrides:
doStartin classorg.springframework.integration.endpoint.MessageProducerSupport
-
checkTaskExecutor
protected void checkTaskExecutor(java.lang.String threadName)Creates a default task executor if none was supplied.- Parameters:
threadName- The thread name.
-
doStop
protected void doStop()- Overrides:
doStopin classorg.springframework.integration.endpoint.MessageProducerSupport
-