Package org.apache.cxf.message

Examples of org.apache.cxf.message.ExchangeImpl


    }

    protected void processSoapProviderIn(Exchange exchange) throws Exception {
        LOG.info("processSoapProviderIn: " + exchange);
        org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint();
        org.apache.cxf.message.Exchange cxfExchange = new ExchangeImpl();
        cxfExchange.put(org.apache.cxf.endpoint.Endpoint.class, cxfEndpoint);
        cxfExchange.put(Bus.class, getBus());
        cxfExchange.setConduit(new NullConduit());
        exchange.setProperty(CxfConstants.CXF_EXCHANGE, cxfExchange);
        org.apache.cxf.message.Message outMessage = CxfSoapBinding.getCxfOutMessage(
                endpoint.getHeaderFilterStrategy(), exchange, true);
        outMessage.put(Message.REQUESTOR_ROLE, Boolean.TRUE);
        outMessage.put(Message.INBOUND_MESSAGE, Boolean.FALSE);
View Full Code Here


        } else {
            message = exchange.getIn();
        }
        assert message != null;
        if (cxfExchange == null) {
            cxfExchange = new ExchangeImpl();
            exchange.setProperty(CxfConstants.CXF_EXCHANGE, cxfExchange);
        }

        CxfHeaderHelper.propagateCamelToCxf(headerFilterStrategy, message.getHeaders(), answer);
View Full Code Here

        return body == null ? new MessageContentsList() : new MessageContentsList(body);
    }
   
    protected Exchange createExchange(Message m, Exchange exchange) {
        if (exchange == null) {
            exchange = new ExchangeImpl();
        }
        exchange.setSynchronous(true);
        exchange.setOutMessage(m);
        exchange.put(Bus.class, cfg.getBus());
        exchange.put(MessageObserver.class, new ClientMessageObserver(cfg));
View Full Code Here

        Bus origBus = BusFactory.getThreadDefaultBus(false);
        BusFactory.setThreadDefaultBus(bus);
        try {
            Exchange exchange = message.getExchange();
            if (exchange == null) {
                exchange = new ExchangeImpl();
                exchange.setInMessage(message);
                message.setExchange(exchange);
            }
            message = createMessage(message);
            message.setExchange(exchange);               
View Full Code Here

            }
           
            Message message = getBinding().createMessage(m);
            Exchange exchange = message.getExchange();
            if (exchange == null) {
                exchange = new ExchangeImpl();
                m.setExchange(exchange);
            }
            exchange.setInMessage(message);
            setExchangeProperties(exchange, message);
   
View Full Code Here

                       Exchange exchange) throws Exception {
        Bus origBus = BusFactory.getThreadDefaultBus(false);
        BusFactory.setThreadDefaultBus(bus);
        try {
            if (exchange == null) {
                exchange = new ExchangeImpl();
            }
            exchange.setSynchronous(false);
            Endpoint endpoint = getEndpoint();
            if (context == null) {
                context = new HashMap<String, Object>();
View Full Code Here

                           Exchange exchange) throws Exception {
        Bus origBus = BusFactory.getThreadDefaultBus(false);
        BusFactory.setThreadDefaultBus(bus);
        try {
            if (exchange == null) {
                exchange = new ExchangeImpl();
            }
            exchange.setSynchronous(true);
            Endpoint endpoint = getEndpoint();

            Map<String, Object> reqContext = null;
View Full Code Here

        }
    }

    public Conduit getConduit() {
        Message message = new MessageImpl();
        Exchange exchange = new ExchangeImpl();
        message.setExchange(exchange);
        setExchangeProperties(exchange, null, null);
        return getConduitSelector().selectConduit(message);
    }
View Full Code Here

            }
            BusFactory.setThreadDefaultBus(bus);
            if (LOG.isLoggable(Level.FINER)) {
                LOG.finer("Processing Message at collocated endpoint.  Request message: " + m);
            }
            Exchange ex = new ExchangeImpl();
            setExchangeProperties(ex, m);
           
            Message inMsg = endpoint.getBinding().createMessage();
            MessageImpl.copyContent(m, inMsg);
           
            //Copy Request Context to Server inBound Message
            //TODO a Context Filter Strategy required.
            inMsg.putAll(m);
   
            inMsg.put(COLOCATED, Boolean.TRUE);
            inMsg.put(Message.REQUESTOR_ROLE, Boolean.FALSE);
            inMsg.put(Message.INBOUND_MESSAGE, Boolean.TRUE);
            OperationInfo oi = ex.get(OperationInfo.class);
            if (oi != null) {
                inMsg.put(MessageInfo.class, oi.getInput());
            }
            ex.setInMessage(inMsg);
            inMsg.setExchange(ex);
           
            if (LOG.isLoggable(Level.FINEST)) {
                LOG.finest("Build inbound interceptor chain.");
            }
   
            //Add all interceptors between USER_LOGICAL and INVOKE.
            SortedSet<Phase> phases = new TreeSet<Phase>(bus.getExtension(PhaseManager.class).getInPhases());
            ColocUtil.setPhases(phases, Phase.USER_LOGICAL, Phase.INVOKE);
            InterceptorChain chain = ColocUtil.getInInterceptorChain(ex, phases);
            chain.add(addColocInterceptors());
            inMsg.setInterceptorChain(chain);
   
            //Convert the coloc object type if necessary
            OperationInfo soi = m.getExchange().get(OperationInfo.class);
            if (soi != null && oi != null) {
                if (ColocUtil.isAssignableOperationInfo(soi, Source.class)
                    && !ColocUtil.isAssignableOperationInfo(oi, Source.class)) {
                    // converting source -> pojo
                    ColocUtil.convertSourceToObject(inMsg);
                } else if (ColocUtil.isAssignableOperationInfo(oi, Source.class)
                    && !ColocUtil.isAssignableOperationInfo(soi, Source.class)) {
                    // converting pojo -> source
                    ColocUtil.convertObjectToSource(inMsg);
                }
            }
            chain.doIntercept(inMsg);
            if (soi != null && oi != null) {
                if (ColocUtil.isAssignableOperationInfo(soi, Source.class)
                    && !ColocUtil.isAssignableOperationInfo(oi, Source.class)
                    && ex.getOutMessage() != null) {
                    // converting pojo -> source               
                    ColocUtil.convertObjectToSource(ex.getOutMessage());
                } else if (ColocUtil.isAssignableOperationInfo(oi, Source.class)
                    && !ColocUtil.isAssignableOperationInfo(soi, Source.class)
                    && ex.getOutMessage() != null) {
                    // converting pojo -> source
                    ColocUtil.convertSourceToObject(ex.getOutMessage());
                }
            }
            //Set Server OutBound Message onto InBound Exchange.
            setOutBoundMessage(ex, m.getExchange());
        } finally {
View Full Code Here

                       final HttpServletResponse resp) throws IOException {
        Message inMessage = retrieveFromContinuation(req);
        if (inMessage == null) {
            LOG.fine("Create a new message for processing");
            inMessage = new MessageImpl();
            ExchangeImpl exchange = new ExchangeImpl();
            exchange.setInMessage(inMessage);
            setupMessage(inMessage,
                     config,
                     context,
                     req,
                     resp);

            exchange.setSession(new HTTPSession(req));
            ((MessageImpl)inMessage).setDestination(this);
        } else {
            LOG.fine("Get the message from the request for processing");
        }
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.