Package org.apache.camel.component.bean

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


                    if (exchange.getIn().getBody() == null) {
                        return null;
                    }

                    // if its a bean invocation then if it has no arguments then it should be threaded as null body allowed
                    BeanInvocation bi = exchange.getIn().getBody(BeanInvocation.class);
                    if (bi != null && (bi.getArgs() == null || bi.getArgs().length == 0 || bi.getArgs()[0] == null)) {
                        return null;
                    }
                }

                try {
View Full Code Here


            // special for files so we can work with them out of the box
            InputStream is = exchange.getContext().getTypeConverter().convertTo(InputStream.class, answer);
            answer = new InputSource(is);
        } else if (answer instanceof BeanInvocation) {
            // if its a null bean invocation then handle that
            BeanInvocation bi = exchange.getContext().getTypeConverter().convertTo(BeanInvocation.class, answer);
            if (bi.getArgs() != null && bi.getArgs().length == 1 && bi.getArgs()[0] == null) {
                // its a null argument from the bean invocation so use null as answer
                answer = null;
            }
        } else if (answer instanceof String) {
            answer = new InputSource(new StringReader(answer.toString()));
View Full Code Here

                    if (exchange.getIn().getBody() == null) {
                        return null;
                    }

                    // if its a bean invocation then if it has no arguments then it should be threaded as null body allowed
                    BeanInvocation bi = exchange.getIn().getBody(BeanInvocation.class);
                    if (bi != null && (bi.getArgs() == null || bi.getArgs().length == 0 || bi.getArgs()[0] == null)) {
                        return null;
                    }
                }

                try {
View Full Code Here

                // special for files so we can work with them out of the box
                InputStream is = exchange.getContext().getTypeConverter().convertTo(InputStream.class, exchange, body);
                answer = new InputSource(is);
            } else if (body instanceof BeanInvocation) {
                // if its a null bean invocation then handle that specially
                BeanInvocation bi = exchange.getContext().getTypeConverter().convertTo(BeanInvocation.class, exchange, body);
                if (bi.getArgs() != null && bi.getArgs().length == 1 && bi.getArgs()[0] == null) {
                    // its a null argument from the bean invocation so use null as answer
                    answer = null;
                }
            } else if (body instanceof String) {
                answer = new InputSource(new StringReader((String) body));
View Full Code Here

TOP

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

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.