Class IntegrationObjectSupport
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- InitializingBean,- ApplicationContextAware,- ExpressionCapable,- NamedComponent
- Direct Known Subclasses:
- AbstractConnectionFactory,- AbstractEndpoint,- AbstractHandleMessageAdvice,- AbstractMailReceiver,- AbstractMessageChannel,- AbstractRequestHandlerAdvice,- AbstractTransformer,- CodecMessageConverter,- DefaultHeaderChannelRegistry,- ExpressionEvaluatingTransactionSynchronizationProcessor,- HeaderEnricher,- HeaderFilter,- MessageHandlerSupport
public abstract class IntegrationObjectSupport
extends Object
implements BeanNameAware, 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
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final ExpressionParserprotected final LogAccessor
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidstatic <T> TextractTypeIfPossible(Object targetObject, Class<T> expectedType) static UUIDprotected ApplicationContextReturns theApplicationContext.getId()if theApplicationContextis available.protected BeanFactoryprotected DestinationResolver<MessageChannel>Will return the name of this component identified bycomponentNamefield.Subclasses may implement this method to provide component type information.Return 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.voidsetComponentName(String componentName) Sets the name of this component.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()
- 
Field Details- 
EXPRESSION_PARSER
- 
logger
 
- 
- 
Constructor Details- 
IntegrationObjectSupportpublic IntegrationObjectSupport()
 
- 
- 
Method Details- 
setBeanName- Specified by:
- setBeanNamein interface- BeanNameAware
 
- 
getBeanName- Specified by:
- getBeanNamein interface- NamedComponent
 
- 
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.
 
- 
getComponentTypeSubclasses may implement this method to provide component type information.- Specified by:
- getComponentTypein interface- NamedComponent
 
- 
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
- 
getConversionService
- 
setConversionService
- 
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
 
-