Package org.apache.cxf.message

Examples of org.apache.cxf.message.ExchangeImpl


        final CamelDestination destination = setupCamelDestination(true);

        // set up MessageObserver for handlering the conduit message
        MessageObserver observer = new MessageObserver() {
            public void onMessage(Message m) {
                Exchange exchange = new ExchangeImpl();
                exchange.setInMessage(m);
                m.setExchange(exchange);
                verifyReceivedMessage(m);
                verifyHeaders(m, outMessage);
                // setup the message for
                Conduit backConduit;
View Full Code Here


        }
    }

    protected void sendoutMessage(Conduit conduit, Message message, Boolean isOneWay) throws IOException {

        Exchange exchange = new ExchangeImpl();
        exchange.setOneWay(isOneWay);
        message.setExchange(exchange);
        exchange.setInMessage(message);
        try {
            conduit.prepare(message);
        } catch (IOException ex) {
            assertFalse("CamelConduit can't perpare to send out message", false);
            ex.printStackTrace();
View Full Code Here

    public void process(CxfExchange exchange) {
        try {
            CxfBinding binding = endpoint.getBinding();
            MessageImpl m = binding.createCxfMessage(exchange);
            ExchangeImpl e = new ExchangeImpl();
            e.setInMessage(m);
            m.put(LocalConduit.DIRECT_DISPATCH, Boolean.TRUE);
            m.setDestination(destination);
            synchronized (conduit) {
                conduit.prepare(m);

                // now lets wait for the response
                if (endpoint.isInOut()) {
                    Message response = future.getResponse();

                    // TODO - why do we need to ignore the returned message and
                    // get the out message from the exchange!
                    response = e.getOutMessage();
                    binding.storeCxfResponse(exchange, response);
                }
            }
        } catch (IOException e) {
            throw new RuntimeCamelException(e);
View Full Code Here

           
            ContextPropertiesMapping.mapRequestfromJaxws2Cxf(reqContext);
            message.putAll(reqContext);
            //need to do context mapping from jax-ws to cxf message
           
            Exchange exchange = new ExchangeImpl();
            exchange.setOneWay(isOneWay);
   
            exchange.setOutMessage(message);
            setExchangeProperties(exchange, endpoint);
   
            message.setContent(Object.class, obj);
           
            if (obj instanceof SOAPMessage) {
                message.setContent(SOAPMessage.class, obj);
            } else if (obj instanceof Source) {
                message.setContent(Source.class, obj);
            } else if (obj instanceof DataSource) {
                message.setContent(DataSource.class, obj);
            }
     
            message.put(Message.REQUESTOR_ROLE, Boolean.TRUE);
   
            PhaseInterceptorChain chain = getDispatchOutChain(endpoint);
            message.setInterceptorChain(chain);
   
            // setup conduit selector
            prepareConduitSelector(message);
           
            // execute chain
            chain.doIntercept(message);
           
            Exception exp = message.getContent(Exception.class);
            if (exp == null && exchange.getInMessage() != null) {
                exp = exchange.getInMessage().getContent(Exception.class);
            }

            if (exp != null) {
                getConduitSelector().complete(exchange);
                if (getBinding() instanceof SOAPBinding && exp instanceof Fault) {
View Full Code Here

            rme.getSource().addSequence(ss, false);
           
            for (RMMessage m : ms) {               
               
                Message message = new MessageImpl();
                Exchange exchange = new ExchangeImpl();
                message.setExchange(exchange);
                if (null != conduit) {
                    exchange.setConduit(conduit);
                    message.put(Message.REQUESTOR_ROLE, Boolean.TRUE);
                }
                exchange.put(Endpoint.class, endpoint);
                exchange.put(Service.class, endpoint.getService());
                if (endpoint.getEndpointInfo().getService() != null) {
                    exchange.put(ServiceInfo.class, endpoint.getEndpointInfo().getService());
                    exchange.put(InterfaceInfo.class, endpoint.getEndpointInfo().getService().getInterface());
                }
                exchange.put(Binding.class, endpoint.getBinding());
                exchange.put(BindingInfo.class, endpoint.getEndpointInfo().getBinding());
                exchange.put(Bus.class, bus);
               
                SequenceType st = RMUtils.getWSRMFactory().createSequenceType();
                st.setIdentifier(ss.getIdentifier());
                st.setMessageNumber(m.getMessageNumber());
                if (ss.isLastMessage() && ss.getCurrentMessageNr().equals(m.getMessageNumber())) {
View Full Code Here

    public boolean process(Exchange camelExchange, AsyncCallback callback) {
        LOG.trace("Process exchange: {} in an async way.", camelExchange);
       
        try {
            // create CXF exchange
            ExchangeImpl cxfExchange = new ExchangeImpl();
            // set the Bus on the exchange in case the CXF interceptor need to access it from exchange
            cxfExchange.put(Bus.class, endpoint.getBus());
           
            // prepare binding operation info
            BindingOperationInfo boi = prepareBindingOperation(camelExchange, cxfExchange);
           
            Map<String, Object> invocationContext = new HashMap<String, Object>();
View Full Code Here

     */
    public void process(Exchange camelExchange) throws Exception {
        LOG.trace("Process exchange: {} in sync way.", camelExchange);
       
        // create CXF exchange
        ExchangeImpl cxfExchange = new ExchangeImpl();
        // set the Bus on the exchange in case the CXF interceptor need to access it from exchange
        cxfExchange.put(Bus.class, endpoint.getBus());
       
        // prepare binding operation info
        BindingOperationInfo boi = prepareBindingOperation(camelExchange, cxfExchange);
       
        Map<String, Object> invocationContext = new HashMap<String, Object>();
View Full Code Here

    public boolean process(Exchange camelExchange, AsyncCallback callback) {
        LOG.trace("Process exchange: {} in an async way.", camelExchange);
       
        try {
            // create CXF exchange
            ExchangeImpl cxfExchange = new ExchangeImpl();
            // set the Bus on the exchange in case the CXF interceptor need to access it from exchange
            cxfExchange.put(Bus.class, endpoint.getBus());
           
            // prepare binding operation info
            BindingOperationInfo boi = prepareBindingOperation(camelExchange, cxfExchange);
           
            Map<String, Object> invocationContext = new HashMap<String, Object>();
View Full Code Here

     */
    public void process(Exchange camelExchange) throws Exception {
        LOG.trace("Process exchange: {} in sync way.", camelExchange);
       
        // create CXF exchange
        ExchangeImpl cxfExchange = new ExchangeImpl();
        // set the Bus on the exchange in case the CXF interceptor need to access it from exchange
        cxfExchange.put(Bus.class, endpoint.getBus());
       
        // prepare binding operation info
        BindingOperationInfo boi = prepareBindingOperation(camelExchange, cxfExchange);
       
        Map<String, Object> invocationContext = new HashMap<String, Object>();
View Full Code Here

            if (ex == null) {
                ex = (org.apache.cxf.message.Exchange)exchange.getProperty(CxfConstants.CXF_EXCHANGE);
                exchange.setExchange(ex);
            }
            if (ex == null) {
                ex = new ExchangeImpl();
                exchange.setExchange(ex);
            }
            assert ex != null;
            InvokingContext invokingContext = ex.get(InvokingContext.class);
            if (invokingContext == null) {
View Full Code Here

TOP

Related Classes of org.apache.cxf.message.ExchangeImpl

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.