Examples of BeanInvocation


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

            // 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

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

    public void marshal(Exchange exchange, final Object inputObject, OutputStream stream) throws IOException {
        checkElementNameStrategy(exchange);

        String soapAction = getSoapActionFromExchange(exchange);
        if (soapAction == null && inputObject instanceof BeanInvocation) {
            BeanInvocation beanInvocation = (BeanInvocation) inputObject;
            WebMethod webMethod = beanInvocation.getMethod().getAnnotation(WebMethod.class);
            if (webMethod != null && webMethod.action() != null) {
                soapAction = webMethod.action();
            }
        }
        Body body = new Body();
View Full Code Here

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

     */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    private JAXBElement<?> createBodyContentFromObject(final Object inputObject, String soapAction) {
        Object paramObject;
        if (inputObject instanceof BeanInvocation) {
            BeanInvocation bi = (BeanInvocation) inputObject;
            if (bi.getArgs() == null || bi.getArgs().length == 0) {
                paramObject = null;
            } else if (bi.getArgs().length == 1) {
                paramObject = bi.getArgs()[0];
            } else {
                throw new RuntimeCamelException("SoapDataFormat does not work with "
                        + "Beaninvocations that contain more than 1 parameter");               
            }
        } else {
View Full Code Here

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

                // special for files so we can work with them out of the box
                InputStream is = exchange.getContext().getTypeConverter().convertTo(InputStream.class, 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, 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

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

                    // special for files so we can work with them out of the box
                    InputStream is = exchange.getContext().getTypeConverter().convertTo(InputStream.class, body);
                    source = converter.toDOMSource(is);
                } else if (body instanceof BeanInvocation) {
                    // if its a null bean invocation then handle that
                    BeanInvocation bi = exchange.getContext().getTypeConverter().convertTo(BeanInvocation.class, 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
                        source = null;
                    }
                } else if (body instanceof String) {
                    source = converter.toDOMSource(body.toString());
View Full Code Here

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

            // 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

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

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

        checkElementNameStrategy(exchange);

        String soapAction = (String) exchange.getIn().getHeader(Exchange.SOAP_ACTION);
        if (soapAction == null && inputObject instanceof BeanInvocation) {
            BeanInvocation beanInvocation = (BeanInvocation) inputObject;
            WebMethod webMethod = beanInvocation.getMethod().getAnnotation(WebMethod.class);
            if (webMethod != null && webMethod.action() != null) {
                soapAction = webMethod.action();
            }
        }
        Body body = new Body();
View Full Code Here

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

     */
    @SuppressWarnings("unchecked")
    private JAXBElement<?> createBodyContentFromObject(final Object inputObject, String soapAction) {
        Object graph;
        if (inputObject instanceof BeanInvocation) {
            BeanInvocation bi = (BeanInvocation) inputObject;
            if (bi.getArgs().length > 1) {
                throw new RuntimeCamelException(
                        "SoapDataFormat does not work with Beaninvocations that contain more than 1 parameter");
            }
            graph = (bi.getArgs().length == 1) ? bi.getArgs()[0] : null;
        } else {
            graph = inputObject;
        }
        QName name = elementNameStrategy.findQNameForSoapActionOrType(soapAction, graph.getClass());
        return new JAXBElement(name, graph.getClass(), graph);
View Full Code Here

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
TOP
Copyright © 2018 www.massapi.com. 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.