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,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, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME -
Constructor Summary
Constructors Constructor Description AbstractMessageSource() -
Method Summary
Modifier and Type Method Description protected Message<T>buildMessage(Object result)voiddestroy()protected abstract ObjectdoReceive()Subclasses must implement this method.StringgetBeanName()StringgetComponentName()StringgetManagedName()StringgetManagedType()IntegrationManagement.ManagementOverridesgetOverrides()Return the overrides.booleanisLoggingEnabled()Return whether logging is enabled.Message<T>receive()Retrieve the next available message from this source.voidregisterMetricsCaptor(MetricsCaptor metricsCaptorToSet)Inject aMetricsCaptorvoidsetBeanName(String name)voidsetHeaderExpressions(Map<String,Expression> headerExpressions)voidsetLoggingEnabled(boolean loggingEnabled)Enable logging or not.voidsetManagedName(String managedName)voidsetManagedType(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, setConversionServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAsMethods inherited from interface org.springframework.integration.core.MessageSource
getIntegrationPatternTypeMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getComponentType
-
Constructor Details
-
AbstractMessageSource
public AbstractMessageSource()
-
-
Method Details
-
setHeaderExpressions
-
registerMetricsCaptor
Description copied from interface:IntegrationManagementInject aMetricsCaptor- Specified by:
registerMetricsCaptorin interfaceIntegrationManagement- Parameters:
metricsCaptorToSet- the captor.
-
setBeanName
- Specified by:
setBeanNamein interfaceBeanNameAware
-
getBeanName
- Specified by:
getBeanNamein interfaceNamedComponent
-
setManagedType
- Specified by:
setManagedTypein interfaceIntegrationManagement
-
getManagedType
- Specified by:
getManagedTypein interfaceIntegrationManagement
-
setManagedName
- Specified by:
setManagedNamein interfaceIntegrationManagement
-
getManagedName
- Specified by:
getManagedNamein interfaceIntegrationManagement
-
getComponentName
- Specified by:
getComponentNamein interfaceNamedComponent
-
isLoggingEnabled
public boolean isLoggingEnabled()Description copied from interface:IntegrationManagementReturn whether logging is enabled.- Specified by:
isLoggingEnabledin interfaceIntegrationManagement- Returns:
- true if enabled.
-
setLoggingEnabled
public void setLoggingEnabled(boolean loggingEnabled)Description copied from interface:IntegrationManagementEnable logging or not.- Specified by:
setLoggingEnabledin interfaceIntegrationManagement- Parameters:
loggingEnabled- dalse to disable.
-
getOverrides
Description copied from interface:IntegrationManagementReturn the overrides.- Specified by:
getOverridesin interfaceIntegrationManagement- Returns:
- the overrides.
-
receive
Description copied from interface:MessageSourceRetrieve the next available message from this source. Returnsnullif no message is available.- Specified by:
receivein interfaceMessageSource<T>- Returns:
- The message or null.
-
buildMessage
-
doReceive
Subclasses must implement this method. Typically the returned value will be thepayloadof type T, but the returned value may also be aMessageinstance whose payload is of type T; also can beAbstractIntegrationMessageBuilderwhich is used for additional headers population.- Returns:
- The value returned.
-
destroy
public void destroy()- Specified by:
destroyin interfaceDisposableBean- Specified by:
destroyin interfaceIntegrationManagement
-