Examples of ExchangeImpl


Examples of org.apache.cxf.message.ExchangeImpl

        m.put(Message.ENDPOINT_ADDRESS, currentURI.toString());
        m.put(Message.REQUEST_URI, currentURI.toString());
       
        m.put(Message.CONTENT_TYPE, headers.getFirst(HttpHeaders.CONTENT_TYPE));
       
        Exchange exchange = new ExchangeImpl();
        exchange.setSynchronous(true);
        exchange.setOutMessage(m);
        exchange.put(Bus.class, cfg.getBus());
        exchange.put(MessageObserver.class, new ClientMessageObserver(cfg));
        exchange.put(Endpoint.class, cfg.getConduitSelector().getEndpoint());
        exchange.setOneWay("true".equals(headers.getFirst(Message.ONE_WAY_REQUEST)));
        // no need for the underlying conduit to throw the IO exceptions in case of
        // client requests returning error HTTP code, it can be overridden if really needed
        exchange.put("org.apache.cxf.http.no_io_exceptions", true);
        m.setExchange(exchange);
       
        PhaseInterceptorChain chain = setupOutInterceptorChain(cfg);
        m.setInterceptorChain(chain);
       
        // context
        if (cfg.getRequestContext().size() > 0 || cfg.getResponseContext().size() > 0) {
            Map<String, Object> context = new HashMap<String, Object>();
            context.put(REQUEST_CONTEXT, cfg.getRequestContext());
            context.put(RESPONSE_CONTEXT, cfg.getResponseContext());
            m.put(Message.INVOCATION_CONTEXT, context);
            m.putAll(cfg.getRequestContext());
            exchange.putAll(cfg.getRequestContext());
            exchange.putAll(cfg.getResponseContext());
        }
       
        //setup conduit selector
        prepareConduitSelector(m);
        exchange.put(Service.class, cfg.getConduitSelector().getEndpoint().getService());
       
        return m;
    }
View Full Code Here

Examples of org.apache.qpid.server.exchange.ExchangeImpl

        bindingArguments.put("ping", new String[]{"x-filter-jms-selector=select=1", "x-qpid-no-local"});
        bindingArguments.put("pong", new String[]{"x-filter-jms-selector=select='pong'"});
        File config = writeConfigFile(vhostName, queueName, exchangeName, false, new String[]{"ping","pong"}, bindingArguments);
        VirtualHost vhost = createVirtualHost(vhostName, config);

        ExchangeImpl exch = vhost.getExchange(getName() +".direct");
        Collection<BindingImpl> bindings = ((AbstractExchange)exch).getBindings();
        assertNotNull("Bindings cannot be null", bindings);
        assertEquals("Unexpected number of bindings", 3, bindings.size());

        boolean foundPong = false;
View Full Code Here

Examples of org.apache.servicemix.nmr.core.ExchangeImpl

public class MessageExchangeImplTest extends TestCase {

    public void testMep() {
        MessageExchange me;

        me = new MessageExchangeImpl(new ExchangeImpl(Pattern.InOnly));
        assertEquals("http://www.w3.org/2004/08/wsdl/in-only", me.getPattern().toString());

        me = new MessageExchangeImpl(new ExchangeImpl(Pattern.InOut));
        assertEquals("http://www.w3.org/2004/08/wsdl/in-out", me.getPattern().toString());

        me = new MessageExchangeImpl(new ExchangeImpl(Pattern.InOptionalOut));
        assertEquals("http://www.w3.org/2004/08/wsdl/in-opt-out", me.getPattern().toString());

        me = new MessageExchangeImpl(new ExchangeImpl(Pattern.RobustInOnly));
        assertEquals("http://www.w3.org/2004/08/wsdl/robust-in-only", me.getPattern().toString());
    }
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.