Class DefaultCamelBeanPostProcessor

  • All Implemented Interfaces:
    org.apache.camel.spi.CamelBeanPostProcessor

    public class DefaultCamelBeanPostProcessor
    extends Object
    implements org.apache.camel.spi.CamelBeanPostProcessor
    A bean post processor which implements the Bean Integration features in Camel. Features such as the Bean Injection of objects like 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.

    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
      • camelContext

        protected org.apache.camel.CamelContext camelContext
    • Constructor Detail

      • DefaultCamelBeanPostProcessor

        public DefaultCamelBeanPostProcessor()
      • DefaultCamelBeanPostProcessor

        public DefaultCamelBeanPostProcessor​(org.apache.camel.CamelContext camelContext)
    • Method Detail

      • postProcessBeforeInitialization

        public Object postProcessBeforeInitialization​(Object bean,
                                                      String beanName)
                                               throws Exception
        Specified by:
        postProcessBeforeInitialization in interface org.apache.camel.spi.CamelBeanPostProcessor
        Throws:
        Exception
      • postProcessAfterInitialization

        public Object postProcessAfterInitialization​(Object bean,
                                                     String beanName)
                                              throws Exception
        Specified by:
        postProcessAfterInitialization in interface org.apache.camel.spi.CamelBeanPostProcessor
        Throws:
        Exception
      • getOrLookupCamelContext

        public org.apache.camel.CamelContext getOrLookupCamelContext()
        Strategy to get the CamelContext to use.
      • canPostProcessBean

        protected boolean canPostProcessBean​(Object bean,
                                             String beanName)
      • bindToRegistrySupported

        protected boolean bindToRegistrySupported()
        Whether support for the annotation BindToRegistry is supported. This is only intended for standalone runtimes such as camel-main, camel-quarkus, etc.
      • canSetCamelContext

        protected boolean canSetCamelContext​(Object bean,
                                             String beanName)
      • injectField

        public void injectField​(Field field,
                                String endpointUri,
                                String endpointProperty,
                                Object bean,
                                String beanName,
                                boolean binding)
      • injectFieldBeanConfig

        public void injectFieldBeanConfig​(Field field,
                                          String name,
                                          Object bean,
                                          String beanName)
      • injectFieldProperty

        public void injectFieldProperty​(Field field,
                                        String propertyName,
                                        String propertyDefaultValue,
                                        Object bean,
                                        String beanName)
      • injectClass

        protected void injectClass​(Object bean,
                                   String beanName)
      • injectNestedClasses

        protected void injectNestedClasses​(Object bean,
                                           String beanName)
      • setterInjection

        protected void setterInjection​(Method method,
                                       Object bean,
                                       String beanName)
      • setterPropertyInjection

        public void setterPropertyInjection​(Method method,
                                            String propertyValue,
                                            String propertyDefaultValue,
                                            Object bean,
                                            String beanName)
      • setterBeanInjection

        public void setterBeanInjection​(Method method,
                                        String name,
                                        Object bean,
                                        String beanName)
      • setterBeanConfigInjection

        public void setterBeanConfigInjection​(Method method,
                                              String name,
                                              Object bean,
                                              String beanName)