Package org.apache.camel.component.bean

Examples of org.apache.camel.component.bean.RegistryBean


        BeanHolder beanHolder;

        if (ObjectHelper.isNotEmpty(ref)) {
            if (cache != null && cache) {
                // cache the registry lookup which avoids repeat lookup in the registry
                beanHolder = new RegistryBean(routeContext.getCamelContext(), ref).createCacheHolder();
            } else {
                beanHolder = new RegistryBean(routeContext.getCamelContext(), ref);
            }
            // bean holder will check if the bean exists
            bean = beanHolder.getBean();
            answer = new BeanProcessor(beanHolder);
        } else {
View Full Code Here


    public Object evaluate(E exchange) {
        // either use registry lookup or a constant bean
        BeanHolder holder;
        if (bean == null) {
            holder = new RegistryBean(exchange.getContext(), beanName);
        } else {
            holder = new ConstantBeanHolder(bean, exchange.getContext());
        }

        BeanProcessor processor = new BeanProcessor(holder);
View Full Code Here

    @Override
    public Processor createProcessor(RouteContext routeContext) {
        BeanProcessor answer;
        if (ref != null) {
            answer = new BeanProcessor(new RegistryBean(routeContext.getCamelContext(), ref));
        } else {
            if (bean == null) {
                ObjectHelper.notNull(beanType, "bean, ref or beanType");
                bean = CamelContextHelper.newInstance(routeContext.getCamelContext(), beanType);
            }
View Full Code Here

        BeanProcessor answer;
        Class<?> clazz = bean != null ? bean.getClass() : null;
        BeanHolder beanHolder;

        if (ObjectHelper.isNotEmpty(ref)) {
            beanHolder = new RegistryBean(routeContext.getCamelContext(), ref);
            // bean holder will check if the bean exists
            bean = beanHolder.getBean();
            answer = new BeanProcessor(beanHolder);
        } else {
            if (bean == null) {
View Full Code Here

        // either use registry lookup or a constant bean
        BeanHolder holder;
        if (bean != null) {
            holder = new ConstantBeanHolder(bean, context);
        } else if (beanName != null) {
            holder = new RegistryBean(context, beanName);
        } else if (type != null) {
            holder = new ConstantTypeBeanHolder(type, context);
        } else {
            throw new IllegalArgumentException("Either bean, beanName or type should be set on " + this);
        }
View Full Code Here

    @Override
    public Processor createProcessor(RouteContext routeContext) {
        BeanProcessor answer;
        if (ObjectHelper.isNotEmpty(ref)) {
            RegistryBean beanHolder = new RegistryBean(routeContext.getCamelContext(), ref);
            // bean holder will check if the bean exists
            bean = beanHolder.getBean();
            answer = new BeanProcessor(beanHolder);
        } else {
            if (bean == null) {
                ObjectHelper.notNull(beanType, "bean, ref or beanType", this);
                Class<?> clazz;
View Full Code Here

    public Object evaluate(Exchange exchange) {
        // either use registry lookup or a constant bean
        BeanHolder holder;
        if (bean == null) {
            holder = new RegistryBean(exchange.getContext(), beanName);
        } else {
            holder = new ConstantBeanHolder(bean, exchange.getContext());
        }

        // invoking the bean can either be the easy way or using OGNL
View Full Code Here

    protected String assertionFailureMessage(E exchange) {
        return "bean: " + beanName + " method: " + method;
    }

    public Object evaluate(E exchange) {
        BeanProcessor processor = new BeanProcessor(new RegistryBean(exchange.getContext(), beanName));
        if (method != null) {
            processor.setMethod(method);
        }
        try {
            Exchange newExchange = exchange.copy();
View Full Code Here

    @Override
    public Processor createProcessor(RouteContext routeContext) {
        BeanProcessor answer;
        if (ref != null) {
            answer = new BeanProcessor(new RegistryBean(routeContext.getCamelContext(), ref));
        } else {
            if (bean == null) {
                ObjectHelper.notNull(beanType, "bean, ref or beanType");
                bean = CamelContextHelper.newInstance(routeContext.getCamelContext(), beanType);
            }
View Full Code Here

        // either use registry lookup or a constant bean
        BeanHolder holder;
        if (bean != null) {
            holder = new ConstantBeanHolder(bean, exchange.getContext());
        } else if (beanName != null) {
            holder = new RegistryBean(exchange.getContext(), beanName);
        } else if (type != null) {
            holder = new ConstantTypeBeanHolder(type, exchange.getContext());
        } else {
            throw new IllegalArgumentException("Either bean, beanName or type should be set on " + this);
        }
View Full Code Here

TOP

Related Classes of org.apache.camel.component.bean.RegistryBean

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.