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: 1.1 $

Constructor Summary
CamelBeanPostProcessor()
           
 
Method Summary
protected  void addConsumer(org.apache.camel.Consumer consumer)
           
protected  void consumerInjection(Method method, Object bean)
           
protected  void consumerInjection(Object bean)
           
protected  org.apache.camel.Processor createConsumerProcessor(Object pojo, Method method, org.apache.camel.Endpoint endpoint)
          Create a processor which invokes the given method when an incoming message exchange is received
 SpringCamelContext getCamelContext()
           
protected  org.apache.camel.Endpoint getEndpointInjection(String uri, String name)
           
protected  Object getEndpointInjectionValue(org.apache.camel.EndpointInject annotation, Class<?> type)
          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)
           
 
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)

createConsumerProcessor

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


addConsumer

protected void addConsumer(org.apache.camel.Consumer consumer)

getEndpointInjectionValue

protected Object getEndpointInjectionValue(org.apache.camel.EndpointInject annotation,
                                           Class<?> type)
Creates the value for the injection point for the given annotation


getEndpointInjection

protected org.apache.camel.Endpoint getEndpointInjection(String uri,
                                                         String name)


Copyright © 2007 Apache Software Foundation. All Rights Reserved.