Package org.apache.camel.component.bean

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


        // check for method exists
        if (method != null) {
            answer.setMethod(method);

            // check there is a method with the given name, and leverage BeanInfo for that
            BeanInfo beanInfo = beanHolder.getBeanInfo();
            if (bean != null) {
                // there is a bean instance, so check for any methods
                if (!beanInfo.hasMethod(method)) {
                    throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, bean, method));
                }
            } else if (clazz != null) {
                // there is no bean instance, so check for static methods only
                if (!beanInfo.hasStaticMethod(method)) {
                    throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, clazz, method, true));
                }
            }
        }
View Full Code Here


    }

    protected void setUp() throws Exception {
        super.setUp();
        exchange.getIn().setBody("James");
        info = new BeanInfo(bean.getClass(), strategy);
    }
View Full Code Here

        // check for method exists
        if (method != null) {
            answer.setMethod(method);

            // check there is a method with the given name, and leverage BeanInfo for that
            BeanInfo beanInfo = beanHolder.getBeanInfo();
            if (bean != null) {
                // there is a bean instance, so check for any methods
                if (!beanInfo.hasMethod(method)) {
                    throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, bean, method));
                }
            } else if (clazz != null) {
                // there is no bean instance, so check for static methods only
                if (!beanInfo.hasStaticMethod(method)) {
                    throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, clazz, method, true));
                }
            }
        }
View Full Code Here

        }
        if (method != null) {
            answer.setMethod(method);

            // check there is a method with the given name, and leverage BeanInfo for that
            BeanInfo info = new BeanInfo(routeContext.getCamelContext(), bean.getClass());
            if (!info.hasMethod(method)) {
                throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, bean, method));
            }
        }
        return answer;
    }
View Full Code Here

            ExpressionIllegalSyntaxException cause = new ExpressionIllegalSyntaxException(method);
            throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(bean != null ? bean : type, method, cause));
        }

        if (bean != null) {
            BeanInfo info = new BeanInfo(context, bean.getClass());
            if (!info.hasMethod(method)) {
                throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, bean, method));
            }
        } else {
            BeanInfo info = new BeanInfo(context, type);
            // must be a static method as we do not have a bean instance to invoke
            if (!info.hasStaticMethod(method)) {
                throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, type, method, true));
            }
        }
    }
View Full Code Here

        // check for method exists
        if (method != null) {
            answer.setMethod(method);

            // check there is a method with the given name, and leverage BeanInfo for that
            BeanInfo beanInfo = beanHolder.getBeanInfo();
            if (bean != null) {
                // there is a bean instance, so check for any methods
                if (!beanInfo.hasMethod(method)) {
                    throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, bean, method));
                }
            } else if (clazz != null) {
                // there is no bean instance, so check for static methods only
                if (!beanInfo.hasStaticMethod(method)) {
                    throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, clazz, method, true));
                }
            }
        }
View Full Code Here

            ExpressionIllegalSyntaxException cause = new ExpressionIllegalSyntaxException(method);
            throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(bean != null ? bean : type, method, cause));
        }

        if (bean != null) {
            BeanInfo info = new BeanInfo(context, bean.getClass());
            if (!info.hasMethod(method)) {
                throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, bean, method));
            }
        } else {
            BeanInfo info = new BeanInfo(context, type);
            // must be a static method as we do not have a bean instance to invoke
            if (!info.hasStaticMethod(method)) {
                throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, type, method, true));
            }
        }
    }
View Full Code Here

            ExpressionIllegalSyntaxException cause = new ExpressionIllegalSyntaxException(method);
            throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(bean != null ? bean : type, method, cause));
        }

        if (bean != null) {
            BeanInfo info = new BeanInfo(context, bean.getClass());
            if (!info.hasMethod(method)) {
                throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, bean, method));
            }
        } else {
            BeanInfo info = new BeanInfo(context, type);
            // must be a static method as we do not have a bean instance to invoke
            if (!info.hasStaticMethod(method)) {
                throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, type, method, true));
            }
        }
    }
View Full Code Here

    /**
     * Create a processor which invokes the given method when an incoming
     * message exchange is received
     */
    protected Processor createConsumerProcessor(final Object pojo, final Method method, final Endpoint endpoint) {
        BeanInfo info = new BeanInfo(getCamelContext(), method);
        BeanProcessor answer = new BeanProcessor(pojo, info);
        // must ensure the consumer is being executed in an unit of work so synchronization callbacks etc is invoked
        return new UnitOfWorkProcessor(answer);
    }
View Full Code Here

        // check for method exists
        if (method != null) {
            answer.setMethod(method);

            // check there is a method with the given name, and leverage BeanInfo for that
            BeanInfo beanInfo = beanHolder.getBeanInfo();
            if (bean != null) {
                // there is a bean instance, so check for any methods
                if (!beanInfo.hasMethod(method)) {
                    throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, bean, method));
                }
            } else if (clazz != null) {
                // there is no bean instance, so check for static methods only
                if (!beanInfo.hasStaticMethod(method)) {
                    throw ObjectHelper.wrapRuntimeCamelException(new MethodNotFoundException(null, clazz, method, true));
                }
            }
        }
View Full Code Here

TOP

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

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.