org.apache.camel.spring
Class CamelBeanPostProcessor

java.lang.Object
  extended by org.apache.camel.spring.CamelBeanPostProcessor
All Implemented Interfaces:
BeanPostProcessor, ApplicationContextAware

public class CamelBeanPostProcessor
extends Object
implements BeanPostProcessor, 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: 46142 $

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 getInjectionValue(Class<?> type, String endpointUri, String endpointRef, String injectionPointName)
          Creates the object to be injected for an EndpointInject or Produce injection point
protected  void injectField(Field field, String endpointUri, String endpointRef, Object bean)
           
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(ApplicationContext applicationContext)
           
 void setCamelContext(SpringCamelContext camelContext)
           
protected  void setterInjection(Method method, Object bean)
           
protected  void setterInjection(Method method, Object bean, String endpointUri, String endpointRef)
           
protected  void startService(Service service)
           
protected  void subscribeMethod(Method method, Object bean, String endpointUri, String endpointName)
           
 
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 BeansException
Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Throws:
BeansException

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Throws:
BeansException

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
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

injectField

protected void injectField(Field field,
                           String endpointUri,
                           String endpointRef,
                           Object bean)

injectMethods

protected void injectMethods(Object bean)

setterInjection

protected void setterInjection(Method method,
                               Object bean)

setterInjection

protected void setterInjection(Method method,
                               Object bean,
                               String endpointUri,
                               String endpointRef)

consumerInjection

protected void consumerInjection(Object bean)

consumerInjection

protected void consumerInjection(Method method,
                                 Object bean)

subscribeMethod

protected void subscribeMethod(Method method,
                               Object bean,
                               String endpointUri,
                               String endpointName)

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


getInjectionValue

protected Object getInjectionValue(Class<?> type,
                                   String endpointUri,
                                   String endpointRef,
                                   String injectionPointName)
Creates the object to be injected for an EndpointInject or Produce injection point


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 IONA Open Source Community. All Rights Reserved.