Package org.apache.camel.component.cxf.invoker

Examples of org.apache.camel.component.cxf.invoker.InvokingContext


            if (ex == null) {
                ex = new ExchangeImpl();
                exchange.setExchange(ex);
            }
            assert ex != null;
            InvokingContext invokingContext = ex.get(InvokingContext.class);
            if (invokingContext == null) {
                invokingContext = InvokingContextFactory.createContext(dataFormat);
                ex.put(InvokingContext.class, invokingContext);
            }
            Map<Class, Object> params = invokingContext.getRequestContent(inMessage);
            // invoke the stream message with the exchange context
            CxfClient cxfClient = (CxfClient)client;
            // need to get the binding object to create the message
            BindingOperationInfo boi = ex.get(BindingOperationInfo.class);
            Message response = null;
            if (boi == null) {
                // it should be the raw message
                response = new MessageImpl();
            } else {
                // create the message here
                Endpoint ep = ex.get(Endpoint.class);
                response = ep.getBinding().createMessage();
            }
            response.setExchange(ex);
            // invoke the message prepare the context
            Map<String, Object> context = new HashMap<String, Object>();
            Map<String, Object> responseContext = CxfBinding.propogateContext(inMessage, context);

            Object result = cxfClient.dispatch(params, context, ex);
            ex.setOutMessage(response);
            invokingContext.setResponseContent(response, result);
            // copy the response context to the response
            CxfBinding.storeCXfResponseContext(response, responseContext);
            CxfBinding.storeCxfResponse(endpoint.getHeaderFilterStrategy(), exchange, response);

View Full Code Here


            if (ex == null) {
                ex = new ExchangeImpl();
                exchange.setExchange(ex);
            }
            ObjectHelper.notNull(ex, "exchange");
            InvokingContext invokingContext = ex.get(InvokingContext.class);
            if (invokingContext == null) {
                invokingContext = InvokingContextFactory.createContext(dataFormat);
                ex.put(InvokingContext.class, invokingContext);
            }
            Map<Class, Object> params = invokingContext.getRequestContent(inMessage);
            // invoke the stream message with the exchange context
            CxfClient cxfClient = (CxfClient)client;
            // need to get the binding object to create the message
            BindingOperationInfo boi = ex.get(BindingOperationInfo.class);
            Message response = null;
            if (boi == null) {
                // it should be the raw message
                response = new MessageImpl();
            } else {
                // create the message here
                Endpoint ep = ex.get(Endpoint.class);
                response = ep.getBinding().createMessage();
            }
            response.setExchange(ex);
            // invoke the message prepare the context
            Map<String, Object> context = new HashMap<String, Object>();
            Map<String, Object> responseContext = CxfBinding.propogateContext(inMessage, context);

            Object result = cxfClient.dispatch(params, context, ex);
            ex.setOutMessage(response);
            invokingContext.setResponseContent(response, result);
            // copy the response context to the response
            CxfBinding.storeCXfResponseContext(response, responseContext);
            CxfBinding.storeCxfResponse(endpoint.getHeaderFilterStrategy(), exchange, response);

View Full Code Here

                if (ex == null) {
                    ex = new ExchangeImpl();
                    exchange.setExchange(ex);
                }
                assert ex != null;
                InvokingContext invokingContext = ex.get(InvokingContext.class);
                if (invokingContext == null) {
                    invokingContext = InvokingContextFactory.createContext(dataFormat);
                    ex.put(InvokingContext.class, invokingContext);
                }
                Map params = invokingContext.getRequestContent(inMessage);
                // invoke the stream message with the exchange context
                CxfClient cxfClient = (CxfClient)client;
                // need to get the binding object to create the message
                BindingOperationInfo boi = ex.get(BindingOperationInfo.class);
                Message response = null;
                if (boi == null) {
                    // it should be the raw message
                    response = new MessageImpl();
                } else {
                    // create the message here
                    Endpoint ep = ex.get(Endpoint.class);
                    response = ep.getBinding().createMessage();
                }
                response.setExchange(ex);
                // invoke the message prepare the context
                Map<String, Object> context = new HashMap<String, Object>();
                Map<String, Object> requestContext = new HashMap<String, Object>();
                Map<String, Object> responseContext = new HashMap<String, Object>();
                // TODO Get the requestContext from the CamelExchange
                context.put(CxfClient.REQUEST_CONTEXT, requestContext);
                context.put(CxfClient.RESPONSE_CONTEXT, responseContext);
                try {
                    Object result = cxfClient.dispatch(params, context, ex);
                    ex.setOutMessage(response);
                    invokingContext.setResponseContent(response, result);
                    // copy the response context to the response
                    response.putAll(responseContext);
                    cxfBinding.storeCxfResponse(exchange, response);
                } catch (Exception e) {
                    response.setContent(Exception.class, e);
View Full Code Here

            if (ex == null) {
                ex = new ExchangeImpl();
                exchange.setExchange(ex);
            }
            ObjectHelper.notNull(ex, "exchange");
            InvokingContext invokingContext = ex.get(InvokingContext.class);
            if (invokingContext == null) {
                invokingContext = InvokingContextFactory.createContext(dataFormat);
                ex.put(InvokingContext.class, invokingContext);
            }
            Map<Class, Object> params = invokingContext.getRequestContent(inMessage);
            // invoke the stream message with the exchange context
            CxfClient cxfClient = (CxfClient)client;
            // need to get the BindingOperationInfo object to create the message
            BindingOperationInfo boi = getBindingOperationInfo(exchange);
            Message response = null;
            if (boi == null) {
                // it should be the raw message
                response = new MessageImpl();
            } else {
                // create the message here
                Endpoint ep = ex.get(Endpoint.class);
                response = ep.getBinding().createMessage();
                // set the BindingOperationInfo object here
                ex.put(BindingOperationInfo.class, boi);
            }
            response.setExchange(ex);
            // invoke the message prepare the context
            Map<String, Object> context = new HashMap<String, Object>();
            Map<String, Object> responseContext = CxfBinding.propogateContext(exchange, context);

            Object result = cxfClient.dispatch(params, context, ex);
            ex.setOutMessage(response);
            invokingContext.setResponseContent(response, result);
            // copy the response context to the response
            CxfBinding.storeCXfResponseContext(response, responseContext);
            CxfBinding.storeCxfResponse(endpoint.getHeaderFilterStrategy(), exchange, response);
        }
View Full Code Here

            if (ex == null) {
                ex = new ExchangeImpl();
                exchange.setExchange(ex);
            }
            ObjectHelper.notNull(ex, "exchange");
            InvokingContext invokingContext = ex.get(InvokingContext.class);
            if (invokingContext == null) {
                invokingContext = InvokingContextFactory.createContext(dataFormat);
                ex.put(InvokingContext.class, invokingContext);
            }
            Map<Class, Object> params = invokingContext.getRequestContent(inMessage);
            // invoke the stream message with the exchange context
            CxfClient cxfClient = (CxfClient)client;
            // need to get the binding object to create the message
            BindingOperationInfo boi = ex.get(BindingOperationInfo.class);
            Message response = null;
            if (boi == null) {
                // it should be the raw message
                response = new MessageImpl();
            } else {
                // create the message here
                Endpoint ep = ex.get(Endpoint.class);
                response = ep.getBinding().createMessage();
            }
            response.setExchange(ex);
            // invoke the message prepare the context
            Map<String, Object> context = new HashMap<String, Object>();
            Map<String, Object> responseContext = CxfBinding.propogateContext(exchange, context);

            Object result = cxfClient.dispatch(params, context, ex);
            ex.setOutMessage(response);
            invokingContext.setResponseContent(response, result);
            // copy the response context to the response
            CxfBinding.storeCXfResponseContext(response, responseContext);
            CxfBinding.storeCxfResponse(endpoint.getHeaderFilterStrategy(), exchange, response);
        }
View Full Code Here

        BindingOperationInfo boi = exchange.get(BindingOperationInfo.class);
        if (boi != null) {
            exchange.put(BindingMessageInfo.class, boi.getOutput());
        }

        InvokingContext invokingContext = exchange.get(InvokingContext.class);
        assert invokingContext != null;
       
        InterceptorChain chain = invokingContext.getResponseOutInterceptorChain(exchange);
        if (chain != null) {
            outMessage.setInterceptorChain(chain);
           
            //Initiate the OutBound Chain.
            chain.doIntercept(outMessage);
View Full Code Here

                    }
                } 
            } else {
                // get the invocation context
                org.apache.cxf.message.Exchange ex = exchange.getExchange();
                InvokingContext invokingContext = ex.get(InvokingContext.class);
                Object params = invokingContext.getRequestContent(inMessage);
                // invoke the stream message with the exchange context
                CxfClient cxfClient = (CxfClient) client;
                // invoke the message
                //TODO need setup the call context here
                //TODO need to handle the one way message
                Object result = cxfClient.dispatch(params, null, ex);
                // need to get the binding object to create the message
                BindingOperationInfo boi = ex.get(BindingOperationInfo.class);
                Message response = null;               
                if (boi == null) {
                    // it should be the raw message                   
                    response = new MessageImpl();
                } else {
                    // create the message here
                    Endpoint ep = ex.get(Endpoint.class);                   
                    response = ep.getBinding().createMessage();
                }               
                response.setExchange(ex);
                ex.setOutMessage(response);               
                invokingContext.setResponseContent(response, result);
                cxfBinding.storeCxfResponse(exchange, response);
            }
        } catch (Exception e) {
            //TODO add the falut message handling work
            throw new RuntimeCamelException(e);
View Full Code Here

            exchange = new ExchangeImpl();
            exchange.setInMessage(message);
        }
        setExchangeProperties(exchange, message);
       
        InvokingContext invokingContext = exchange.get(InvokingContext.class);
        assert invokingContext != null;
        invokingContext.setEndpointFaultObservers((EndpointImpl)endpoint, bus);
       
        if (LOG.isLoggable(Level.FINEST)) {
            LOG.finest("Build inbound interceptor chain and inject routing interceptor");
        }
        // now we just support the raw message and the payload message
        PhaseInterceptorChain chain = invokingContext.getRequestInInterceptorChain(exchange);

        message.setInterceptorChain(chain);
        chain.setFaultObserver(endpoint.getOutFaultObserver());
        chain.doIntercept(message);       
    }
View Full Code Here

                if (ex == null) {
                    ex = new ExchangeImpl();
                    exchange.setExchange(ex);
                }
                assert ex != null;
                InvokingContext invokingContext = ex.get(InvokingContext.class);
                if (invokingContext == null) {
                    invokingContext = InvokingContextFactory.createContext(dataFormat);
                    ex.put(InvokingContext.class, invokingContext);
                }
                Map<Class, Object> params = invokingContext.getRequestContent(inMessage);
                // invoke the stream message with the exchange context
                CxfClient cxfClient = (CxfClient)client;
                // need to get the binding object to create the message
                BindingOperationInfo boi = ex.get(BindingOperationInfo.class);
                Message response = null;
                if (boi == null) {
                    // it should be the raw message
                    response = new MessageImpl();
                } else {
                    // create the message here
                    Endpoint ep = ex.get(Endpoint.class);
                    response = ep.getBinding().createMessage();
                }
                response.setExchange(ex);
                // invoke the message prepare the context
                Map<String, Object> context = new HashMap<String, Object>();
                Map<String, Object> responseContext = CxfBinding.propogateContext(inMessage, context);
                try {
                    Object result = cxfClient.dispatch(params, context, ex);
                    ex.setOutMessage(response);
                    invokingContext.setResponseContent(response, result);
                    // copy the response context to the response
                    CxfBinding.storeCXfResponseContext(response, responseContext);
                    CxfBinding.storeCxfResponse(exchange, response);
                } catch (Exception e) {
                    response.setContent(Exception.class, e);
View Full Code Here

TOP

Related Classes of org.apache.camel.component.cxf.invoker.InvokingContext

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.