Package org.apache.cxf.transport

Examples of org.apache.cxf.transport.ConduitInitiator


            transId = ((SoapBindingInfo)bi).getTransportURI();
            if (transId == null) {
                transId = ei.getTransportId();
            }
        }
        ConduitInitiator conduitInit;
        try {
            ConduitInitiatorManager mgr = bus.getExtension(ConduitInitiatorManager.class);
            if (StringUtils.isEmpty(address)
                || address.startsWith("http")
                || address.startsWith("jms")
                || address.startsWith("soap.udp")) {
                conduitInit = mgr.getConduitInitiator(mapTransportURI(transId, address));
            } else {
                conduitInit = mgr.getConduitInitiatorForUri(address);
            }
            if (conduitInit == null) {
                throw new RuntimeException(String.format(CANNOT_GET_CONDUIT_ERROR, address, transId));
            }
            return conduitInit.getConduit(ei, target);
        } catch (BusException e) {
            throw new RuntimeException(String.format(CANNOT_GET_CONDUIT_ERROR, address, transId));
        }
    }
View Full Code Here


        address = getEPR("bar/foo");
       

        transportFactory = new HTTPTransportFactory();

        final ConduitInitiator ci = new ConduitInitiator() {
            public Conduit getConduit(EndpointInfo targetInfo) throws IOException {
                return decoupledBackChannel;
            }

            public Conduit getConduit(EndpointInfo localInfo, EndpointReferenceType target)
View Full Code Here

    public byte[] invokeBytes(String address, String transport, byte[] message) throws Exception {
        EndpointInfo ei = new EndpointInfo(null, "http://schemas.xmlsoap.org/soap/http");
        ei.setAddress(address);

        ConduitInitiatorManager conduitMgr = getBus().getExtension(ConduitInitiatorManager.class);
        ConduitInitiator conduitInit = conduitMgr.getConduitInitiator(transport);
        Conduit conduit = conduitInit.getConduit(ei);

        TestMessageObserver obs = new TestMessageObserver();
        conduit.setMessageObserver(obs);

        Message m = new MessageImpl();
View Full Code Here

    public byte[] invokeBytes(String address, String transport, String message) throws Exception {
        EndpointInfo ei = new EndpointInfo(null, "http://schemas.xmlsoap.org/soap/http");
        ei.setAddress(address);

        ConduitInitiatorManager conduitMgr = getBus().getExtension(ConduitInitiatorManager.class);
        ConduitInitiator conduitInit = conduitMgr.getConduitInitiator(transport);
        Conduit conduit = conduitInit.getConduit(ei);

        TestMessageObserver obs = new TestMessageObserver();
        conduit.setMessageObserver(obs);

        Message m = new MessageImpl();
View Full Code Here

            } else {
                // check conduits (the address could be supported on
                // client only)
                ConduitInitiatorManager cim = getBus().getExtension(
                        ConduitInitiatorManager.class);
                ConduitInitiator ci = cim
                        .getConduitInitiatorForUri(getAddress());
                if (ci != null) {
                    transportId = ci.getTransportIds().get(0);
                }
            }
        }
        if (transportId != null) {
            ei.setTransportId(transportId);
View Full Code Here

            String transportID = ei.getTransportId();
            try {
                ConduitInitiatorManager conduitInitiatorMgr = exchange.getBus()
                    .getExtension(ConduitInitiatorManager.class);
                if (conduitInitiatorMgr != null) {
                    ConduitInitiator conduitInitiator =
                        conduitInitiatorMgr.getConduitInitiator(transportID);
                    if (conduitInitiator != null) {
                        String add = (String)message.get(Message.ENDPOINT_ADDRESS);
                        String basePath = (String)message.get(Message.BASE_PATH);
                        if (StringUtils.isEmpty(add)
                            || add.equals(ei.getAddress())) {
                            c = conduitInitiator.getConduit(ei);
                            replaceEndpointAddressPropertyIfNeeded(message, add, c);
                        } else {
                            EndpointReferenceType epr = new EndpointReferenceType();
                            AttributedURIType ad = new AttributedURIType();
                            ad.setValue(StringUtils.isEmpty(basePath) ? add : basePath);
                            epr.setAddress(ad);
                            c = conduitInitiator.getConduit(ei, epr);
                        }
                        MessageObserver observer =
                            exchange.get(MessageObserver.class);
                        if (observer != null) {
                            c.setMessageObserver(observer);
View Full Code Here

                                          EndpointReferenceType address) throws IOException {
                Bus bus = inMessage.getExchange().get(Bus.class);
                //this is a response targeting a decoupled endpoint.   Treat it as a oneway so
                //we don't wait for a response.
                inMessage.getExchange().setOneWay(true);
                ConduitInitiator conduitInitiator
                    = bus.getExtension(ConduitInitiatorManager.class)
                        .getConduitInitiatorForUri(reference.getAddress().getValue());
                if (conduitInitiator != null) {
                    Conduit c = conduitInitiator.getConduit(ei, reference);
                    //ensure decoupled back channel input stream is closed
                    c.setMessageObserver(new MessageObserver() {
                        public void onMessage(Message m) {
                            InputStream is = m.getContent(InputStream.class);
                            if (is != null) {
View Full Code Here

    }
   
    @Override
    protected String detectTransportIdFromAddress(String ad) {
        ConduitInitiatorManager cim = getBus().getExtension(ConduitInitiatorManager.class);
        ConduitInitiator ci = cim.getConduitInitiatorForUri(getAddress());
        if (ci != null) {
            return ci.getTransportIds().get(0);
        }   
        return null;
    }
View Full Code Here

    private void sendMtomMessage(String a) throws Exception {
        EndpointInfo ei = new EndpointInfo(null, "http://schemas.xmlsoap.org/wsdl/http");
        ei.setAddress(a);

        ConduitInitiatorManager conduitMgr = getStaticBus().getExtension(ConduitInitiatorManager.class);
        ConduitInitiator conduitInit = conduitMgr.getConduitInitiator("http://schemas.xmlsoap.org/soap/http");
        Conduit conduit = conduitInit.getConduit(ei);

        TestUtilities.TestMessageObserver obs = new TestUtilities.TestMessageObserver();
        conduit.setMessageObserver(obs);

        Message m = new MessageImpl();
View Full Code Here

            } else {
                // check conduits (the address could be supported on
                // client only)
                ConduitInitiatorManager cim = getBus().getExtension(
                        ConduitInitiatorManager.class);
                ConduitInitiator ci = cim
                        .getConduitInitiatorForUri(getAddress());
                if (ci != null) {
                    transportId = ci.getTransportIds().get(0);
                }
            }
        }
        if (transportId != null) {
            ei.setTransportId(transportId);
View Full Code Here

TOP

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

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.