Package org.apache.cxf.transport

Examples of org.apache.cxf.transport.MessageObserver


        if (exchange.isSynchronous() || executor == null) {
            exchange.put(MessageObserver.class, this);
        } else {
            exchange.put(Executor.class, executor);
            exchange.put(MessageObserver.class, new MessageObserver() {
                public void onMessage(final Message message) {
                    if (!message.getExchange()
                        .containsKey(Executor.class.getName() + ".USING_SPECIFIED")) {
                       
                        executor.execute(new Runnable() {
View Full Code Here


       
        if (slcMgr != null) {
            slcMgr.stopServer(this);
        }
       
        MessageObserver mo = getDestination().getMessageObserver();
        if (mo instanceof MultipleEndpointObserver) {
            ((MultipleEndpointObserver)mo).getEndpoints().remove(endpoint);
            if (!((MultipleEndpointObserver)mo).getEndpoints().isEmpty()) {
                return;
            }
View Full Code Here

        if (exchange.isSynchronous() || executor == null) {
            exchange.put(MessageObserver.class, this);
        } else {
            exchange.put(Executor.class, executor);
            exchange.put(MessageObserver.class, new MessageObserver() {
                public void onMessage(final Message message) {
                    if (!message.getExchange()
                        .containsKey(Executor.class.getName() + ".USING_SPECIFIED")) {
                       
                        executor.execute(new Runnable() {
View Full Code Here

                conduit.getClient().setAllowChunking(true);
                conduit.getClient().setChunkingThreshold(0);
            }
        }

        observer = new MessageObserver() {
            public void onMessage(Message m) {
                inMessage = m;
            }
        };
        conduit.setMessageObserver(observer);
View Full Code Here

        if (isRequestor(message)) {
            // client side outbound
            if (getInvoker(message).isOutbound()) {
                message.getInterceptorChain().abort();
               
                MessageObserver observer = (MessageObserver)message.getExchange().get(MessageObserver.class);
                if (!message.getExchange().isOneWay()
                    && observer != null) {
                    Endpoint e = message.getExchange().get(Endpoint.class);
                    Message responseMsg = new MessageImpl();
                    responseMsg.setExchange(message.getExchange());
                    responseMsg = e.getBinding().createMessage(responseMsg);
   
                    // the request message becomes the response message
                    message.getExchange().setInMessage(responseMsg);
                    SOAPMessage soapMessage = ((SOAPMessageContext)context).getMessage();

                    if (soapMessage != null) {
                        responseMsg.setContent(SOAPMessage.class, soapMessage);
                        XMLStreamReader xmlReader = createXMLStreamReaderFromSOAPMessage(soapMessage);
                        responseMsg.setContent(XMLStreamReader.class, xmlReader);
                    }
                    responseMsg.put(PhaseInterceptorChain.STARTING_AT_INTERCEPTOR_ID,
                                    SOAPHandlerInterceptor.class.getName());
                    observer.onMessage(responseMsg);
                }
                //We dont call onCompletion here, as onCompletion will be called by inbound
                //LogicalHandlerInterceptor
            } else {
                // client side inbound - Normal handler message processing
View Full Code Here

        if (exchange.isSynchronous() || executor == null) {
            exchange.put(MessageObserver.class, this);
        } else {
            exchange.put(Executor.class, executor);
            exchange.put(MessageObserver.class, new MessageObserver() {
                public void onMessage(final Message message) {
                    if (!message.getExchange()
                        .containsKey(Executor.class.getName() + ".USING_SPECIFIED")) {
                       
                        executor.execute(new Runnable() {
View Full Code Here

    }

    @Override
    public synchronized void addListener(Destination d, Endpoint e) {
        synchronized (d) {
            MessageObserver mo = d.getMessageObserver();
            if (d.getAddress() != null
                && d.getAddress().getAddress() != null
                && d.getAddress().getAddress().getValue() != null
                && d.getAddress().getAddress().getValue().startsWith("soap.udp")) {
                //soap.udp REQUIRES usage of WS-Addressing... we need to turn this on
View Full Code Here

                        handleResponseInternal();
                    } catch (Throwable e) {
                        ((PhaseInterceptorChain)outMessage.getInterceptorChain()).abort();
                        ((PhaseInterceptorChain)outMessage.getInterceptorChain()).unwind(outMessage);
                        outMessage.setContent(Exception.class, e);
                        MessageObserver mo = outMessage.getInterceptorChain().getFaultObserver();
                        if (mo == null) {
                            mo = outMessage.getExchange().get(MessageObserver.class);
                        }
                        mo.onMessage(outMessage);
                    }
                }
            };
            HTTPClientPolicy policy = getClient(outMessage);
            try {
View Full Code Here

                conduit.getClient().setAllowChunking(true);
                conduit.getClient().setChunkingThreshold(0);
            }
        }

        observer = new MessageObserver() {
            public void onMessage(Message m) {
                inMessage = m;
            }
        };
        conduit.setMessageObserver(observer);
View Full Code Here

        EasyMock.expect(inMsg.getBody(Source.class)).andReturn(source);
        EndpointRegistry endpoints = control.createMock(EndpointRegistry.class);
        EasyMock.expect(nmr.getEndpointRegistry()).andReturn(endpoints);
        EasyMock.expect(nmrTransportFactory.getNmr().getEndpointRegistry()).andReturn(endpoints);
        control.replay();
        observer = new MessageObserver() {
            public void onMessage(Message m) {                   
                inMessage = m;
            }
        };
        destination.setMessageObserver(observer);
View Full Code Here

TOP

Related Classes of org.apache.cxf.transport.MessageObserver

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.