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() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
String |
getApplicationContextId()
Returns the
ApplicationContext.getId() if the
ApplicationContext is available. |
protected BeanFactory |
getBeanFactory() |
String |
getComponentName()
Will return the name of this component identified by
componentName field. |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
ConversionService |
getConversionService() |
protected Properties |
getIntegrationProperties() |
protected <T> T |
getIntegrationProperty(String key,
Class<T> tClass) |
protected MessageBuilderFactory |
getMessageBuilderFactory() |
protected TaskScheduler |
getTaskScheduler() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setBeanFactory(BeanFactory beanFactory) |
void |
setBeanName(String beanName) |
void |
setComponentName(String componentName)
Sets the name of this component.
|
protected void |
setConversionService(ConversionService conversionService) |
void |
setMessageBuilderFactory(MessageBuilderFactory messageBuilderFactory) |
protected void |
setTaskScheduler(TaskScheduler taskScheduler) |
String |
toString() |
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 final void setBeanFactory(BeanFactory beanFactory)
setBeanFactory
in interface BeanFactoryAware
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
public final void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
protected void onInit() throws Exception
Exception
- Any exception.protected final BeanFactory getBeanFactory()
protected TaskScheduler getTaskScheduler()
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 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.