Class IntegrationObjectSupport
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- InitializingBean,- ApplicationContextAware,- ComponentSourceAware,- ExpressionCapable,- NamedComponent
- Direct Known Subclasses:
- AbstractConnectionFactory,- AbstractEndpoint,- AbstractHandleMessageAdvice,- AbstractMailReceiver,- AbstractMessageChannel,- AbstractMessageProcessingTransformer,- AbstractRequestHandlerAdvice,- AbstractTransformer,- CodecMessageConverter,- DefaultHeaderChannelRegistry,- ExpressionEvaluatingTransactionSynchronizationProcessor,- HeaderEnricher,- HeaderFilter,- MessageHandlerSupport
public abstract class IntegrationObjectSupport
extends Object
implements ComponentSourceAware, NamedComponent, ApplicationContextAware, BeanFactoryAware, InitializingBean, ExpressionCapable
A base class that provides convenient access to the bean factory as
 well as 
TaskScheduler and ConversionService instances.
 This is intended to be used as a base class for internal framework components whereas code built upon the integration framework should not require tight coupling with the context but rather rely on standard dependency injection.
- Author:
- Mark Fisher, Oleg Zhurakousky, Josh Long, Stefan Ferstl, Gary Russell, Artem Bilan, Glenn Renfro
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final ExpressionParserprotected final LogAccessor
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidstatic <T> @Nullable TextractTypeIfPossible(@Nullable Object targetObject, Class<T> expectedType) static UUIDprotected ApplicationContext@Nullable StringReturns theApplicationContext.getId()if theApplicationContextis available.protected BeanFactoryReturn the bean name populated by theBeanNameAware.setBeanName(String).protected DestinationResolver<MessageChannel> @Nullable StringReturn a human-readable description of this bean.Will return the name of this component identified bycomponentNamefield.@Nullable ObjectReturn the configuration sourceObjectfor this bean (maybenull).@Nullable ExpressionReturn the primary SpEL expression if this component is expression-based.protected IntegrationPropertiesprotected MessageBuilderFactoryprotected TaskSchedulerprotected booleanReturn the status of this component if it has been initialized already.protected voidonInit()Subclasses may implement this for initialization logic.voidsetApplicationContext(ApplicationContext applicationContext) voidsetBeanFactory(BeanFactory beanFactory) final voidsetBeanName(String beanName) voidsetChannelResolver(DestinationResolver<MessageChannel> channelResolver) Specify theDestinationResolverstrategy to use.voidsetComponentDescription(String description) Set a human-readable description of this bean.voidsetComponentName(String componentName) Sets the name of this component.voidsetComponentSource(Object source) Set a configuration sourceObjectfor this bean definition.voidsetConversionService(ConversionService conversionService) voidsetMessageBuilderFactory(MessageBuilderFactory messageBuilderFactory) final voidsetPrimaryExpression(Expression expression) For expression-based components, set the primary expression.voidsetTaskScheduler(TaskScheduler taskScheduler) Configure aTaskSchedulerfor those components which logic relies on the scheduled tasks.toString()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetComponentType
- 
Field Details- 
EXPRESSION_PARSER
- 
logger
 
- 
- 
Constructor Details- 
IntegrationObjectSupportpublic IntegrationObjectSupport()
 
- 
- 
Method Details- 
setBeanName- Specified by:
- setBeanNamein interface- BeanNameAware
 
- 
getBeanNameDescription copied from interface:ComponentSourceAwareReturn the bean name populated by theBeanNameAware.setBeanName(String).- Specified by:
- getBeanNamein interface- ComponentSourceAware
- Specified by:
- getBeanNamein interface- NamedComponent
- Returns:
- the bean name.
 
- 
getComponentNameWill return the name of this component identified bycomponentNamefield. IfcomponentNamewas not set this method will default to the 'beanName' of this component;- Specified by:
- getComponentNamein interface- NamedComponent
 
- 
setComponentNameSets the name of this component.- Parameters:
- componentName- The component name.
 
- 
setComponentSourceDescription copied from interface:ComponentSourceAwareSet a configuration sourceObjectfor this bean definition. For normalBeanDefinitionthis is supplied by application context automatically. Could be useful when bean is registered at runtime viaSingletonBeanRegistry.registerSingleton(String, Object)- Specified by:
- setComponentSourcein interface- ComponentSourceAware
- Parameters:
- source- the configuration source
 
- 
getComponentSourceDescription copied from interface:ComponentSourceAwareReturn the configuration sourceObjectfor this bean (maybenull). Usually (if not set explicitly) aBeanMetadataElement.getSource().- Specified by:
- getComponentSourcein interface- ComponentSourceAware
- Returns:
- the configuration source for the bean (if any).
 
- 
setComponentDescriptionDescription copied from interface:ComponentSourceAwareSet a human-readable description of this bean. For normal bean definition aBeanDefinition.getDescription()is used.- Specified by:
- setComponentDescriptionin interface- ComponentSourceAware
- Parameters:
- description- the bean description
 
- 
getComponentDescriptionDescription copied from interface:ComponentSourceAwareReturn a human-readable description of this bean. Usually (if not set explicitly) aBeanDefinition.getDescription().- Specified by:
- getComponentDescriptionin interface- ComponentSourceAware
- Returns:
- the bean description (if any).
 
- 
getBeanDescription
- 
setBeanFactory- Specified by:
- setBeanFactoryin interface- BeanFactoryAware
 
- 
setApplicationContext- Specified by:
- setApplicationContextin interface- ApplicationContextAware
- Throws:
- BeansException
 
- 
setChannelResolverSpecify theDestinationResolverstrategy to use. The default is a BeanFactoryChannelResolver.- Parameters:
- channelResolver- The channel resolver.
 
- 
getExpressionDescription copied from interface:ExpressionCapableReturn the primary SpEL expression if this component is expression-based.- Specified by:
- getExpressionin interface- ExpressionCapable
- Returns:
- the expression as a String.
 
- 
setPrimaryExpressionFor expression-based components, set the primary expression.- Parameters:
- expression- the expression.
- Since:
- 4.3
 
- 
afterPropertiesSetpublic final void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- InitializingBean
 
- 
onInitprotected void onInit()Subclasses may implement this for initialization logic.
- 
isInitializedprotected boolean isInitialized()Return the status of this component if it has been initialized already.- Returns:
- the flag if this component has been initialized already.
 
- 
getBeanFactory
- 
setTaskSchedulerConfigure aTaskSchedulerfor those components which logic relies on the scheduled tasks. If not provided, falls back to the globaltaskSchedulerbean in the application context, provided by the Spring Integration infrastructure.- Parameters:
- taskScheduler- the- TaskSchedulerto use.
- Since:
- 5.1.3
- See Also:
 
- 
getTaskScheduler
- 
getChannelResolver
- 
setConversionService
- 
getConversionService
- 
getApplicationContextIdReturns theApplicationContext.getId()if theApplicationContextis available.- Returns:
- The id, or null if there is no application context.
 
- 
getApplicationContext- Returns:
- the applicationContext
 
- 
getIntegrationProperties- Returns:
- The global integration properties.
- See Also:
 
- 
getMessageBuilderFactory
- 
setMessageBuilderFactory
- 
toString
- 
extractTypeIfPossible
- 
generateId
 
-