Package org.apache.camel.cdi

Examples of org.apache.camel.cdi.ContextName


    }

    protected  void detectRouteBuilders(@Observes ProcessAnnotatedType<?> process) throws Exception {
        AnnotatedType<?> annotatedType = process.getAnnotatedType();
        ContextName annotation = annotatedType.getAnnotation(ContextName.class);
        Class<?> javaClass = annotatedType.getJavaClass();
        if (annotation != null && isRoutesBean(javaClass)) {
            addRouteBuilderBean(annotatedType, annotation);
        }
    }
View Full Code Here


     * .apache.camel.cdi.ContextName}
     * so they can be auto-registered
     */
    public void detectProducerRoutes(@Observes ProcessProducerMethod<?, ?> event) {
        Annotated annotated = event.getAnnotated();
        ContextName annotation = annotated.getAnnotation(ContextName.class);
        Class<?> returnType = event.getAnnotatedProducerMethod().getJavaMember().getReturnType();
        if (isRoutesBean(returnType)) {
            addRouteBuilderBean(event.getBean(), annotation);
        }
    }
View Full Code Here

        final InjectionTarget injectionTarget = event.getInjectionTarget();
        AnnotatedType annotatedType = event.getAnnotatedType();
        final Class<Object> beanClass = annotatedType.getJavaClass();
        // TODO this is a bit of a hack - what should the bean name be?
        final String beanName = injectionTarget.toString();
        ContextName contextName = annotatedType.getAnnotation(ContextName.class);
        final BeanAdapter adapter = createBeanAdapter(beanClass, contextName);
        if (!adapter.isEmpty()) {
            DelegateInjectionTarget newTarget = new DelegateInjectionTarget(injectionTarget) {

                @Override
View Full Code Here

     * This is because BeanProvider.injectFields() does not invoke the onInjectionTarget() method so the injection
     * of @Produce / @EndpointInject and processing of the @Consume annotations are not performed.
     */
    public void inject(Object bean) {
        Class<?> beanClass = bean.getClass();
        ContextName contextName = beanClass.getAnnotation(ContextName.class);
        final BeanAdapter adapter = createBeanAdapter(beanClass, contextName);
        if (!adapter.isEmpty()) {
            // TODO this is a bit of a hack - what should the bean name be?
            final String beanName = bean.toString();
            adapter.inject(this, bean, beanName);
View Full Code Here

    }

    protected <T> void detectRouteBuilders(@Observes ProcessAnnotatedType<T> process)
        throws Exception {
        AnnotatedType<T> annotatedType = process.getAnnotatedType();
        ContextName annotation = annotatedType.getAnnotation(ContextName.class);
        Class<T> javaClass = annotatedType.getJavaClass();
        if (annotation != null && isRoutesBean(javaClass)) {
            addRouteBuilderBean(process, annotation);
        }
    }
View Full Code Here

     * Lets detect all producer methods createing instances of {@link RouteBuilder} which are annotated with {@link org.apache.camel.cdi.ContextName}
     * so they can be auto-registered
     */
    public void detectProducerRoutes(@Observes ProcessProducerMethod<?, ?> event) {
        Annotated annotated = event.getAnnotated();
        ContextName annotation = annotated.getAnnotation(ContextName.class);
        Class<?> returnType = event.getAnnotatedProducerMethod().getJavaMember().getReturnType();
        if (isRoutesBean(returnType)) {
            addRouteBuilderBean(event.getBean(), annotation);
        }
    }
View Full Code Here

        final InjectionTarget<Object> injectionTarget = event.getInjectionTarget();
        AnnotatedType<Object> annotatedType = event.getAnnotatedType();
        final Class<Object> beanClass = annotatedType.getJavaClass();
        // TODO this is a bit of a hack - what should the bean name be?
        final String beanName = injectionTarget.toString();
        ContextName contextName = annotatedType.getAnnotation(ContextName.class);
        final BeanAdapter adapter = createBeanAdapter(beanClass, contextName);
        if (!adapter.isEmpty()) {
            DelegateInjectionTarget newTarget = new DelegateInjectionTarget(injectionTarget) {

                @Override
View Full Code Here

     * This is because BeanProvider.injectFields() does not invoke the onInjectionTarget() method so the injection
     * of @Produce / @EndpointInject and processing of the @Consume annotations are not performed.
     */
    public void inject(Object bean) {
        Class<?> beanClass = bean.getClass();
        ContextName contextName = beanClass.getAnnotation(ContextName.class);
        final BeanAdapter adapter = createBeanAdapter(beanClass, contextName);
        if (!adapter.isEmpty()) {
            // TODO this is a bit of a hack - what should the bean name be?
            final String beanName = bean.toString();
            adapter.inject(this, bean, beanName);
View Full Code Here

        producerTemplate.setDefaultEndpoint(endpoint);
        return producerTemplate;
    }

    protected CamelContext getCamelContext(InjectionPoint point, String contextName) {
        ContextName startup = point.getAnnotated().getAnnotation(ContextName.class);
        if (startup == null) {
            Bean<?> bean = point.getBean();
            if (bean != null) {
                startup = bean.getBeanClass().getAnnotation(ContextName.class);
            }
View Full Code Here

    }

    protected  void detectRouteBuilders(@Observes ProcessAnnotatedType<?> process) throws Exception {
        AnnotatedType annotatedType = process.getAnnotatedType();
        ContextName annotation = annotatedType.getAnnotation(ContextName.class);
        Class javaClass = annotatedType.getJavaClass();
        if (annotation != null && isRoutesBean(javaClass)) {
            addRouteBuilderBean(process, annotation);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.cdi.ContextName

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.