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:
Runnable
,Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,SmartInitializingSingleton
,ApplicationContextAware
,ApplicationEventPublisherAware
,Lifecycle
,Phased
,SmartLifecycle
,ExpressionCapable
,MessageProducer
,IntegrationPattern
,CommonSocketOptions
,NamedComponent
,IntegrationInboundManagement
,IntegrationManagement
,ManageableLifecycle
,ManageableSmartLifecycle
,TrackableComponent
,SchedulingAwareRunnable
- Direct Known Subclasses:
UnicastReceivingChannelAdapter
public abstract class AbstractInternetProtocolReceivingChannelAdapter
extends MessageProducerSupport
implements ApplicationEventPublisherAware, SchedulingAwareRunnable, CommonSocketOptions
Base class for inbound TCP/UDP Channel Adapters.
- Since:
- 2.0
- Author:
- Mark Fisher, Gary Russell, Artem Bilan
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides
-
Field Summary
Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleCondition, lifecycleLock
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkTaskExecutor
(String threadName) Creates a default task executor if none was supplied.protected void
doStart()
Take no action by default.protected void
doStop()
Take no action by default.protected ApplicationEventPublisher
int
getPort()
int
int
int
boolean
void
setApplicationEventPublisher
(ApplicationEventPublisher applicationEventPublisher) void
setListening
(boolean listening) void
setLocalAddress
(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
setSoTimeout
(int soTimeout) void
setTaskExecutor
(Executor taskExecutor) Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, isObserved, onInit, registerObservationRegistry, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setObservationConvention, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
destroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.integration.ip.CommonSocketOptions
setSoSendBufferSize
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
destroy, getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, registerMetricsCaptor, setLoggingEnabled, setManagedName, setManagedType
Methods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName, getComponentType
Methods inherited from interface org.springframework.scheduling.SchedulingAwareRunnable
getQualifier, isLongLived
-
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:
setSoTimeout
in interfaceCommonSocketOptions
- Parameters:
soTimeout
- The timeout.- See Also:
-
getSoTimeout
public int getSoTimeout()- Returns:
- the soTimeout
-
setSoReceiveBufferSize
public void setSoReceiveBufferSize(int soReceiveBufferSize) - Specified by:
setSoReceiveBufferSize
in interfaceCommonSocketOptions
- Parameters:
soReceiveBufferSize
- The receive buffer size.- See Also:
-
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
-
setLocalAddress
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 interfaceCommonSocketOptions
- Parameters:
localAddress
- The local address.
-
setPoolSize
public void setPoolSize(int poolSize) -
setTaskExecutor
-
getTaskExecutor
- Returns:
- the taskExecutor
-
getApplicationEventPublisher
-
setApplicationEventPublisher
- Specified by:
setApplicationEventPublisher
in interfaceApplicationEventPublisherAware
-
doStart
protected void doStart()Description copied from class:MessageProducerSupport
Take no action by default. Subclasses may override this if they need lifecycle-managed behavior. Protected by 'lifecycleLock'.- Overrides:
doStart
in classMessageProducerSupport
-
checkTaskExecutor
Creates a default task executor if none was supplied.- Parameters:
threadName
- The thread name.
-
doStop
protected void doStop()Description copied from class:MessageProducerSupport
Take no action by default. Subclasses may override this if they need lifecycle-managed behavior.- Overrides:
doStop
in classMessageProducerSupport
-