Package org.apache.camel.component.bean

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


                throw new IllegalArgumentException("The bean instance is a java.lang.String type: " + bean
                    + ". We suppose you want to refer to a bean instance by its id instead. Please use beanRef.");
            }

            // the holder should either be bean or type based
            beanHolder = bean != null ? new ConstantBeanHolder(bean, routeContext.getCamelContext()) : new ConstantTypeBeanHolder(clazz, routeContext.getCamelContext());
            answer = new BeanProcessor(beanHolder);
        }

        // check for method exists
        if (method != null) {
View Full Code Here


                throw new IllegalArgumentException("The bean instance is a java.lang.String type: " + bean
                    + ". We suppose you want to refer to a bean instance by its id instead. Please use beanRef.");
            }

            // the holder should either be bean or type based
            beanHolder = bean != null ? new ConstantBeanHolder(bean, routeContext.getCamelContext()) : new ConstantTypeBeanHolder(clazz, routeContext.getCamelContext());
            answer = new BeanProcessor(beanHolder);
        }

        // check for method exists
        if (method != null) {
View Full Code Here

        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);
        }
        return holder;
    }
View Full Code Here

        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);
        }

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

        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);
        }

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

                throw new IllegalArgumentException("The bean instance is a java.lang.String type: " + bean
                    + ". We suppose you want to refer to a bean instance by its id instead. Please use beanRef.");
            }

            // the holder should either be bean or type based
            beanHolder = bean != null ? new ConstantBeanHolder(bean, routeContext.getCamelContext()) : new ConstantTypeBeanHolder(clazz, routeContext.getCamelContext());
            answer = new BeanProcessor(beanHolder);
        }

        // check for method exists
        if (method != null) {
View Full Code Here

        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);
        }

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

                throw new IllegalArgumentException("The bean instance is a java.lang.String type: " + bean
                    + ". We suppose you want to refer to a bean instance by its id instead. Please use beanRef.");
            }

            // the holder should either be bean or type based
            beanHolder = bean != null ? new ConstantBeanHolder(bean, routeContext.getCamelContext()) : new ConstantTypeBeanHolder(clazz, routeContext.getCamelContext());
            answer = new BeanProcessor(beanHolder);
        }

        // check for method exists
        if (method != null) {
View Full Code Here

        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);
        }
        return holder;
    }
View Full Code Here

            if (bean != null) {
                beanHolder = new ConstantBeanHolder(bean, routeContext.getCamelContext());
            } else {
                if (isCacheBean() && ObjectHelper.hasDefaultPublicNoArgConstructor(clazz)) {
                    // we can only cache if we can create an instance of the bean, and for that we need a public constructor
                    beanHolder = new ConstantTypeBeanHolder(clazz, routeContext.getCamelContext()).createCacheHolder();
                } else {
                    if (ObjectHelper.hasDefaultPublicNoArgConstructor(clazz)) {
                        beanHolder = new ConstantTypeBeanHolder(clazz, routeContext.getCamelContext());
                    } else {
                        // this is only for invoking static methods on the bean
                        beanHolder = new ConstantStaticTypeBeanHolder(clazz, routeContext.getCamelContext());
                    }
                }
View Full Code Here

TOP

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

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.