public void process()

in bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java [183:265]


    public void process(MessageExchange exchange) throws Exception {

        if (exchange.getStatus() != ExchangeStatus.ACTIVE) {
            return;
        }
        NormalizedMessage nm = exchange.getMessage("in");

        Object newDestinationURI = nm.getProperty(JbiConstants.HTTP_DESTINATION_URI);
        
        
        Message message = ep.getBinding().createMessage();
        if (newDestinationURI != null) {
            ei.setAddress((String) newDestinationURI);
            message.put(Message.ENDPOINT_ADDRESS, newDestinationURI);
        }
        message.put(MessageExchange.class, exchange);
        Exchange cxfExchange = new ExchangeImpl();
        cxfExchange.setConduit(conduit);
        cxfExchange.setSynchronous(isSynchronous());
        cxfExchange.put(MessageExchange.class, exchange);
        
        message.setExchange(cxfExchange);
        cxfExchange.setOutMessage(message);
        cxfExchange.put(CxfBcProvider.class, this);

        QName opeName = exchange.getOperation();
        BindingOperationInfo boi = null;
        if (opeName == null) {
            // if interface only have one operation, may not specify the opeName
            // in MessageExchange
            if (ei.getBinding().getOperations().size() == 1) {
                boi = ei.getBinding().getOperations().iterator().next();
            } else {
                boi = findOperation(nm, message, boi, exchange);
                cxfExchange.put(MessageExchange.class, exchange);
            }
        } else {
            boi = ei.getBinding().getOperation(exchange.getOperation());
        }
        cxfExchange.setOneWay(boi.getOperationInfo().isOneWay());
        cxfExchange.put(BindingOperationInfo.class, boi);
        cxfExchange.put(Endpoint.class, ep);
        cxfExchange.put(Service.class, cxfService);
        cxfExchange.put(Bus.class, getBus());
        PhaseManager pm = getBus().getExtension(PhaseManager.class);

        
        PhaseInterceptorChain outChain = cache.get(pm.getOutPhases(), 
                                                   outList,
                                                   getBus().getOutInterceptors(),
                                                   getBus().getOutFaultInterceptors(),
                                                   getOutInterceptors(),
                                                   getOutFaultInterceptors());

        message.setInterceptorChain(outChain);
        message.setContent(Source.class, nm.getContent());

        conduit.prepare(message);
        
        message.put(org.apache.cxf.message.Message.REQUESTOR_ROLE, true);
        try {
            outChain.doIntercept(message);
            //Check to see if there is a Fault from the outgoing chain
            Exception ex = message.getContent(Exception.class);
            if (ex != null) {
                throw ex;
            }
            ex = message.getExchange().get(Exception.class);
            if (ex != null) {
                throw ex;
            }
            
            conduit.close(message);
        } catch (Exception e) {
            if (!(exchange instanceof InOnly)) {
        	faultProcess(exchange, message, e);
            }
        }
        if (boi.getOperationInfo().isOneWay()) {
            exchange.setStatus(ExchangeStatus.DONE);
            this.getChannel().send(exchange);
        }
    }