Class AbstractMessageSource<T>
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<T>
- Type Parameters:
T
- The payload type.
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,MessageSource<T>
,IntegrationPattern
,NamedComponent
,IntegrationInboundManagement
,IntegrationManagement
- Direct Known Subclasses:
AbstractFetchLimitingMessageSource
,AbstractMongoDbMessageSource
,AmqpMessageSource
,AttributePollingMessageSource
,ByteStreamReadingMessageSource
,CharacterStreamReadingMessageSource
,ExpressionEvaluatingMessageSource
,FeedEntryMessageSource
,FileReadingMessageSource
,HazelcastDistributedSQLMessageSource
,JdbcPollingChannelAdapter
,JmsDestinationPollingSource
,JpaPollingChannelAdapter
,KafkaMessageSource
,MailReceivingMessageSource
,MBeanTreePollingMessageSource
,MessageProcessorMessageSource
,MethodInvokingMessageSource
,R2dbcMessageSource
,RedisStoreMessageSource
,ResourceRetrievingMessageSource
,ScriptExecutingMessageSource
,StoredProcPollingChannelAdapter
@IntegrationManagedResource
public abstract class AbstractMessageSource<T>
extends AbstractExpressionEvaluator
implements MessageSource<T>, IntegrationInboundManagement, NamedComponent, BeanNameAware
Abstract message source.
- Since:
- 2.0
- Author:
- Mark Fisher, Oleg Zhurakousky, 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.util.AbstractExpressionEvaluator
EXPRESSION_PARSER, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildMessage
(Object result) void
destroy()
protected abstract Object
Subclasses must implement this method.Return the overrides.boolean
Return whether logging is enabled.receive()
Retrieve the next available message from this source.void
registerMetricsCaptor
(MetricsCaptor metricsCaptorToSet) Inject aMetricsCaptor
.void
setBeanName
(String name) void
setHeaderExpressions
(Map<String, Expression> headerExpressions) void
setLoggingEnabled
(boolean loggingEnabled) Enable logging or not.void
setManagedName
(String managedName) void
setManagedType
(String managedType) Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, onInit, setBeanFactory, setConversionService
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAs, isObserved, registerObservationRegistry
Methods inherited from interface org.springframework.integration.core.MessageSource
getIntegrationPatternType
Methods inherited from interface org.springframework.integration.support.context.NamedComponent
getComponentType
-
Constructor Details
-
AbstractMessageSource
public AbstractMessageSource()
-
-
Method Details
-
setHeaderExpressions
-
registerMetricsCaptor
Description copied from interface:IntegrationManagement
Inject aMetricsCaptor
. Ignored ifObservationRegistry
is provided.- Specified by:
registerMetricsCaptor
in interfaceIntegrationManagement
- Parameters:
metricsCaptorToSet
- the captor.- See Also:
-
setBeanName
- Specified by:
setBeanName
in interfaceBeanNameAware
-
getBeanName
- Specified by:
getBeanName
in interfaceNamedComponent
-
setManagedType
- Specified by:
setManagedType
in interfaceIntegrationManagement
-
getManagedType
- Specified by:
getManagedType
in interfaceIntegrationManagement
-
setManagedName
- Specified by:
setManagedName
in interfaceIntegrationManagement
-
getManagedName
- Specified by:
getManagedName
in interfaceIntegrationManagement
-
getComponentName
- Specified by:
getComponentName
in interfaceNamedComponent
-
isLoggingEnabled
public boolean isLoggingEnabled()Description copied from interface:IntegrationManagement
Return whether logging is enabled.- Specified by:
isLoggingEnabled
in interfaceIntegrationManagement
- Returns:
- true if enabled.
-
setLoggingEnabled
public void setLoggingEnabled(boolean loggingEnabled) Description copied from interface:IntegrationManagement
Enable logging or not.- Specified by:
setLoggingEnabled
in interfaceIntegrationManagement
- Parameters:
loggingEnabled
- false to disable.
-
getOverrides
Description copied from interface:IntegrationManagement
Return the overrides.- Specified by:
getOverrides
in interfaceIntegrationManagement
- Returns:
- the overrides.
-
receive
Description copied from interface:MessageSource
Retrieve the next available message from this source. Returnsnull
if no message is available.- Specified by:
receive
in interfaceMessageSource<T>
- Returns:
- The message or null.
-
buildMessage
-
doReceive
Subclasses must implement this method. Typically the returned value will be thepayload
of type T, but the returned value may also be aMessage
instance whose payload is of type T; also can beAbstractIntegrationMessageBuilder
which is used for additional headers population.- Returns:
- The value returned.
-
destroy
public void destroy()- Specified by:
destroy
in interfaceDisposableBean
- Specified by:
destroy
in interfaceIntegrationManagement
-