org.apache.camel.spring
Class CamelBeanPostProcessor

java.lang.Object
  extended by org.apache.camel.spring.CamelBeanPostProcessor
All Implemented Interfaces:
org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.context.ApplicationContextAware

public class CamelBeanPostProcessor
extends Object
implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.context.ApplicationContextAware

A post processor to perform injection of Endpoint and Producer instances together with binding methods annotated with @MessageDriven to a Camel consumer.

Version:
$Revision: 642782 $

Constructor Summary
CamelBeanPostProcessor()
           
 
Method Summary
protected  void consumerInjection(Method method, Object bean)
           
protected  void consumerInjection(Object bean)
           
protected  Processor createConsumerProcessor(Object pojo, Method method, Endpoint endpoint)
          Create a processor which invokes the given method when an incoming message exchange is received
protected  PollingConsumer createInjectionPollingConsumer(Endpoint endpoint)
          Factory method to create a started PollingConsumer to be injected into a POJO
protected  Producer createInjectionProducer(Endpoint endpoint)
          A Factory method to create a started Producer to be injected into a POJO
 SpringCamelContext getCamelContext()
           
protected  Endpoint getEndpointInjection(String uri, String name, String injectionPointName)
           
protected  Object getEndpointInjectionValue(EndpointInject annotation, Class<?> type, String injectionPointName)
          Creates the value for the injection point for the given annotation
protected  void injectFields(Object bean)
          A strategy method to allow implementations to perform some custom JBI based injection of the POJO
protected  void injectMethods(Object bean)
           
 Object postProcessAfterInitialization(Object bean, String beanName)
           
 Object postProcessBeforeInitialization(Object bean, String beanName)
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setCamelContext(SpringCamelContext camelContext)
           
protected  void setterInjection(Method method, Object bean)
           
protected  void startService(Service service)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CamelBeanPostProcessor

public CamelBeanPostProcessor()
Method Detail

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws org.springframework.beans.BeansException
Specified by:
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
Throws:
org.springframework.beans.BeansException

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws org.springframework.beans.BeansException
Specified by:
postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
Throws:
org.springframework.beans.BeansException

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

getCamelContext

public SpringCamelContext getCamelContext()

setCamelContext

public void setCamelContext(SpringCamelContext camelContext)

injectFields

protected void injectFields(Object bean)
A strategy method to allow implementations to perform some custom JBI based injection of the POJO

Parameters:
bean - the bean to be injected

injectMethods

protected void injectMethods(Object bean)

setterInjection

protected void setterInjection(Method method,
                               Object bean)

consumerInjection

protected void consumerInjection(Object bean)

consumerInjection

protected void consumerInjection(Method method,
                                 Object bean)

startService

protected void startService(Service service)
                     throws Exception
Throws:
Exception

createConsumerProcessor

protected Processor createConsumerProcessor(Object pojo,
                                            Method method,
                                            Endpoint endpoint)
Create a processor which invokes the given method when an incoming message exchange is received


getEndpointInjectionValue

protected Object getEndpointInjectionValue(EndpointInject annotation,
                                           Class<?> type,
                                           String injectionPointName)
Creates the value for the injection point for the given annotation


createInjectionPollingConsumer

protected PollingConsumer createInjectionPollingConsumer(Endpoint endpoint)
Factory method to create a started PollingConsumer to be injected into a POJO


createInjectionProducer

protected Producer createInjectionProducer(Endpoint endpoint)
A Factory method to create a started Producer to be injected into a POJO


getEndpointInjection

protected Endpoint getEndpointInjection(String uri,
                                        String name,
                                        String injectionPointName)


Copyright © 2008 Apache Software Foundation. All Rights Reserved.