public abstract class IntegrationObjectSupport extends Object implements BeanNameAware, NamedComponent, ApplicationContextAware, BeanFactoryAware, InitializingBean
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.
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger
Logger that is available to subclasses
|
Constructor and Description |
---|
IntegrationObjectSupport() |
protected final org.apache.commons.logging.Log logger
public final void setBeanName(String beanName)
setBeanName
in interface BeanNameAware
public final String getComponentName()
componentName
field.
If componentName
was not set this method will default to the 'beanName' of this component;getComponentName
in interface NamedComponent
public void setComponentName(String componentName)
componentName
- The component name.public String getComponentType()
getComponentType
in interface NamedComponent
public void setBeanFactory(BeanFactory beanFactory)
setBeanFactory
in interface BeanFactoryAware
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
public void setChannelResolver(DestinationResolver<MessageChannel> channelResolver)
DestinationResolver
strategy to use.
The default is a BeanFactoryChannelResolver.channelResolver
- The channel resolver.public final void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
protected void onInit() throws Exception
Exception
- Any exception.protected final BeanFactory getBeanFactory()
protected TaskScheduler getTaskScheduler()
protected DestinationResolver<MessageChannel> getChannelResolver()
protected void setTaskScheduler(TaskScheduler taskScheduler)
public final ConversionService getConversionService()
protected void setConversionService(ConversionService conversionService)
public String getApplicationContextId()
ApplicationContext.getId()
if the
ApplicationContext
is available.protected ApplicationContext getApplicationContext()
protected Properties getIntegrationProperties()
IntegrationContextUtils.getIntegrationProperties(BeanFactory)
protected MessageBuilderFactory getMessageBuilderFactory()
public void setMessageBuilderFactory(MessageBuilderFactory messageBuilderFactory)
protected <T> T getIntegrationProperty(String key, Class<T> tClass)
T
- The expected type of the property.key
- Integration property.tClass
- the class to convert a value of Integration property.protected <T> T extractTypeIfPossible(Object targetObject, Class<T> expectedType)