public class DefaultCamelBeanPostProcessor extends Object
Endpoint
and
ProducerTemplate
together with support for
POJO Consuming via the
Consume
annotation along with
POJO Producing via the
Produce
annotation along with other annotations such as
DynamicRouter
for creating a Dynamic router via annotations.
RecipientList
for creating a Recipient List router via annotations.
RoutingSlip
for creating a Routing Slip router via annotations.
Components such as camel-spring, and camel-blueprint can leverage this post processor to hook in Camel
bean post processing into their bean processing framework.Modifier and Type | Field and Description |
---|---|
protected CamelContext |
camelContext |
protected CamelPostProcessorHelper |
camelPostProcessorHelper |
protected static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
DefaultCamelBeanPostProcessor() |
DefaultCamelBeanPostProcessor(CamelContext camelContext) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canPostProcessBean(Object bean,
String beanName) |
protected boolean |
canSetCamelContext(Object bean,
String beanName) |
CamelContext |
getOrLookupCamelContext()
Strategy to get the
CamelContext to use. |
CamelPostProcessorHelper |
getPostProcessorHelper()
Strategy to get the
CamelPostProcessorHelper |
void |
injectField(Field field,
String endpointUri,
String endpointRef,
String endpointProperty,
Object bean,
String beanName) |
void |
injectFieldBean(Field field,
String name,
Object bean,
String beanName) |
void |
injectFieldProperty(Field field,
String propertyName,
String propertyDefaultValue,
Object bean,
String beanName) |
protected void |
injectFields(Object bean,
String beanName)
A strategy method to allow implementations to perform some custom JBI
based injection of the POJO
|
protected void |
injectMethods(Object bean,
String beanName) |
Object |
postProcessAfterInitialization(Object bean,
String beanName)
Apply this post processor to the given new bean instance after any bean
initialization callbacks (like
afterPropertiesSet
or a custom init-method). |
Object |
postProcessBeforeInitialization(Object bean,
String beanName)
Apply this post processor to the given new bean instance before any bean
initialization callbacks (like
afterPropertiesSet
or a custom init-method). |
void |
setterBeanInjection(Method method,
String name,
Object bean,
String beanName) |
protected void |
setterInjection(Method method,
Object bean,
String beanName) |
void |
setterInjection(Method method,
Object bean,
String beanName,
String endpointUri,
String endpointRef,
String endpointProperty) |
void |
setterPropertyInjection(Method method,
String propertyValue,
String propertyDefaultValue,
Object bean,
String beanName) |
protected static final org.slf4j.Logger LOG
protected CamelPostProcessorHelper camelPostProcessorHelper
protected CamelContext camelContext
public DefaultCamelBeanPostProcessor()
public DefaultCamelBeanPostProcessor(CamelContext camelContext)
public Object postProcessBeforeInitialization(Object bean, String beanName) throws Exception
afterPropertiesSet
or a custom init-method). The bean will already be populated with property values.
The returned bean instance may be a wrapper around the original.bean
- the new bean instancebeanName
- the name of the beannull
, no subsequent BeanPostProcessors will be invokedException
- is thrown if error post processing beanpublic Object postProcessAfterInitialization(Object bean, String beanName) throws Exception
afterPropertiesSet
or a custom init-method). The bean will already be populated with property values.
The returned bean instance may be a wrapper around the original.bean
- the new bean instancebeanName
- the name of the beannull
, no subsequent BeanPostProcessors will be invokedException
- is thrown if error post processing beanpublic CamelContext getOrLookupCamelContext()
CamelContext
to use.public CamelPostProcessorHelper getPostProcessorHelper()
CamelPostProcessorHelper
protected boolean canPostProcessBean(Object bean, String beanName)
protected boolean canSetCamelContext(Object bean, String beanName)
protected void injectFields(Object bean, String beanName)
bean
- the bean to be injectedpublic void injectField(Field field, String endpointUri, String endpointRef, String endpointProperty, Object bean, String beanName)
public void injectFieldBean(Field field, String name, Object bean, String beanName)
public void injectFieldProperty(Field field, String propertyName, String propertyDefaultValue, Object bean, String beanName)
protected void injectMethods(Object bean, String beanName)
protected void setterInjection(Method method, Object bean, String beanName)
public void setterInjection(Method method, Object bean, String beanName, String endpointUri, String endpointRef, String endpointProperty)
public void setterPropertyInjection(Method method, String propertyValue, String propertyDefaultValue, Object bean, String beanName)
public void setterBeanInjection(Method method, String name, Object bean, String beanName)
Apache Camel