Package org.apache.camel

Examples of org.apache.camel.Consume


        }
        return true;
    }

    public void consumerInjection(Method method, Object bean, String beanName) {
        Consume consume = method.getAnnotation(Consume.class);
        if (consume != null && matchContext(consume.context())) {
            LOG.info("Creating a consumer for: " + consume);
            subscribeMethod(method, bean, beanName, consume.uri(), consume.ref());
        }
    }
View Full Code Here


        }
        return true;
    }

    public void consumerInjection(Method method, Object bean, String beanName) {
        Consume consume = method.getAnnotation(Consume.class);
        if (consume != null && matchContext(consume.context())) {
            LOG.info("Creating a consumer for: " + consume);
            subscribeMethod(method, bean, beanName, consume.uri(), consume.ref());
        }
    }
View Full Code Here

        final Bean<?> bean = event.getBean();
        Class<?> beanClass = bean.getBeanClass();
        ReflectionHelper.doWithMethods(beanClass, new ReflectionHelper.MethodCallback() {
            @Override
            public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
                Consume consume = method.getAnnotation(Consume.class);
                if (consume != null) {
                    eagerBeans.add(bean);
                }
            }
        });
View Full Code Here

            }
        });
        ReflectionHelper.doWithMethods(beanClass, new ReflectionHelper.MethodCallback() {
            @Override
            public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
                Consume consume = method.getAnnotation(Consume.class);
                if (consume != null) {
                    adapter.addConsumeMethod(method);
                }
                Produce produce = method.getAnnotation(Produce.class);
                if (produce != null) {
View Full Code Here

     * Perform injections
     */
    public void inject(CamelExtension camelExtension, Object reference,
                                String beanName) {
        for (Method method : consumeMethods) {
            Consume annotation = method.getAnnotation(Consume.class);
            if (annotation != null) {
                String contextName = CamelExtension.getCamelContextName(annotation.context(), startup);
                DefaultCamelBeanPostProcessor postProcessor = camelExtension.getPostProcessor(
                        contextName);
                if (postProcessor != null) {
                    postProcessor.getPostProcessorHelper().consumerInjection(method, reference, beanName);
                }
            }
        }
        for (Method method : produceMethods) {
            Produce annotation = method.getAnnotation(Produce.class);
            if (annotation != null) {
                String contextName = CamelExtension.getCamelContextName(annotation.context(), startup);
                DefaultCamelBeanPostProcessor postProcessor = camelExtension.getPostProcessor(
                        contextName);
                if (postProcessor != null && postProcessor.getPostProcessorHelper().matchContext(contextName)) {
                    postProcessor.setterInjection(method, reference, beanName, annotation.uri(), annotation.ref(),
                            annotation.property());
                }
            }
        }
        for (Method method : endpointMethods) {
            EndpointInject annotation = method.getAnnotation(EndpointInject.class);
            if (annotation != null) {
                String contextName = CamelExtension.getCamelContextName(annotation.context(), startup);
                DefaultCamelBeanPostProcessor postProcessor = camelExtension.getPostProcessor(
                        contextName);
                if (postProcessor != null && postProcessor.getPostProcessorHelper().matchContext(contextName)) {
                    postProcessor.setterInjection(method, reference, beanName, annotation.uri(), annotation.ref(),
                            annotation.property());

                }
            }
        }
        for (Field field : produceFields) {
            Produce annotation = field.getAnnotation(Produce.class);
            if (annotation != null) {
                String contextName = CamelExtension.getCamelContextName(annotation.context(), startup);
                DefaultCamelBeanPostProcessor postProcessor = camelExtension.getPostProcessor(
                        contextName);
                if (postProcessor != null && postProcessor.getPostProcessorHelper().matchContext(contextName)) {
                    postProcessor.injectField(field, annotation.uri(), annotation.ref(),
                            annotation.property(), reference, beanName);
                }
            }
        }
        for (Field field : endpointFields) {
            EndpointInject annotation = field.getAnnotation(EndpointInject.class);
            String contextName = CamelExtension.getCamelContextName(annotation.context(), startup);
            DefaultCamelBeanPostProcessor postProcessor = camelExtension.getPostProcessor(
                    contextName);
            if (postProcessor != null && postProcessor.getPostProcessorHelper().matchContext(contextName)) {
                postProcessor.injectField(field, annotation.uri(), annotation.ref(),
                        annotation.property(), reference, beanName);
            }
        }
    }
View Full Code Here

        final Bean<?> bean = event.getBean();
        Class<?> beanClass = bean.getBeanClass();
        ReflectionHelper.doWithMethods(beanClass, new ReflectionHelper.MethodCallback() {
            @Override
            public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
                Consume consume = method.getAnnotation(Consume.class);
                if (consume != null) {
                    eagerBeans.add(bean);
                }
            }
        });
View Full Code Here

            }
        });
        ReflectionHelper.doWithMethods(beanClass, new ReflectionHelper.MethodCallback() {
            @Override
            public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
                Consume consume = method.getAnnotation(Consume.class);
                if (consume != null) {
                    adapter.addConsumeMethod(method);
                }
                Produce produce = method.getAnnotation(Produce.class);
                if (produce != null) {
View Full Code Here

    public void setCamelContext(CamelContext camelContext) {
        this.camelContext = camelContext;
    }

    public void consumerInjection(Method method, Object bean) {
        Consume consume = method.getAnnotation(Consume.class);
        if (consume != null) {
            LOG.info("Creating a consumer for: " + consume);
            subscribeMethod(method, bean, consume.uri(), consume.ref());
        }
    }
View Full Code Here

        final Bean<?> bean = event.getBean();
        Class<?> beanClass = bean.getBeanClass();
        ReflectionHelper.doWithMethods(beanClass, new ReflectionHelper.MethodCallback() {
            @Override
            public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
                Consume consume = method.getAnnotation(Consume.class);
                if (consume != null) {
                    eagerBeans.add(bean);
                }
            }
        });
View Full Code Here

            }
        });
        ReflectionHelper.doWithMethods(beanClass, new ReflectionHelper.MethodCallback() {
            @Override
            public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
                Consume consume = method.getAnnotation(Consume.class);
                if (consume != null) {
                    adapter.addConsumeMethod(method);
                }
                Produce produce = method.getAnnotation(Produce.class);
                if (produce != null) {
View Full Code Here

TOP

Related Classes of org.apache.camel.Consume

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.