Examples of DestinationFactory


Examples of org.apache.cxf.transport.DestinationFactory

    public EndpointInfo buildEndpoint(ServiceInfo service, BindingInfo bi, Port port) {
        List elements = port.getExtensibilityElements();
        String ns = null;

        DestinationFactory factory = null;
        EndpointInfo ei = null;

        if (null != elements && elements.size() > 0) {
            for (ExtensibilityElement el : CastUtils.cast(elements, ExtensibilityElement.class)) {
                ns = el.getElementType().getNamespaceURI();
View Full Code Here

Examples of org.apache.cxf.transport.DestinationFactory

            transId = ((SoapBindingInfo)bi).getTransportURI();
            if (transId == null) {
                transId = ei.getTransportId();
            }
        }
        DestinationFactory destinationFactory;
        try {
            DestinationFactoryManager mgr = bus.getExtension(DestinationFactoryManager.class);
            if (StringUtils.isEmpty(address)
                || address.startsWith("http")
                || address.startsWith("jms")
                || address.startsWith("soap.udp")
                || address.startsWith("/")) {
                destinationFactory = mgr.getDestinationFactory(mapTransportURI(transId, address));
            } else {
                destinationFactory = mgr.getDestinationFactoryForUri(address);
            }
            return destinationFactory.getDestination(ei, bus);
        } catch (BusException e) {
            IOException ex = new IOException("Could not find destination factory for transport " + transId);
            ex.initCause(e);
            throw ex;
        }
View Full Code Here

Examples of org.apache.cxf.transport.DestinationFactory

        private static ServletTransportFactory getTransport(final Bus bus)
        {
            final DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class) ;
            try
            {
                final DestinationFactory df = dfm.getDestinationFactory("http://cxf.apache.org/transports/http/configuration") ;
                if (df instanceof ServletTransportFactory)
                {
                    return (ServletTransportFactory)df ;
                }
            }
View Full Code Here

Examples of org.apache.cxf.transport.DestinationFactory

    protected void replaceDestinationFactory() {
      
        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
        try {
            DestinationFactory df = dfm
                .getDestinationFactory("http://cxf.apache.org/transports/http/configuration");
            if (df instanceof ServletTransportFactory) {
                servletTransportFactory = (ServletTransportFactory)df;
                LOG.info("DESTIONFACTORY_ALREADY_REGISTERED");
                return;
            }
        } catch (BusException e) {
            // why are we throwing a busexception if the DF isn't found?
        }

       
        DestinationFactory factory = createServletTransportFactory();

        for (String s : factory.getTransportIds()) {
            registerTransport(factory, s);
        }
        LOG.info("REPLACED_HTTP_DESTIONFACTORY");
    }
View Full Code Here

Examples of org.apache.cxf.transport.DestinationFactory

     * server mainline.
     */   
    protected EndpointInfo createEndpointInfo() throws BusException {
        String transportId = getTransportId();
        if (transportId == null && getAddress() != null) {
            DestinationFactory df = getDestinationFactory();
            if (df == null) {
                DestinationFactoryManager dfm = getBus().getExtension(DestinationFactoryManager.class);
                df = dfm.getDestinationFactoryForUri(getAddress());
            }

            if (df != null) {
                transportId = df.getTransportIds().get(0);
            }
        }

        //default to http transport
        if (transportId == null) {
View Full Code Here

Examples of org.apache.cxf.transport.DestinationFactory

            //load it to force the factory to load
            dfm.getDestinationFactory(bindingID);
        } catch (BusException ex) {
            //ignore
        }
        DestinationFactory df = dfm.getDestinationFactoryForUri(address);

        String transportId = null;
        if (df != null && df.getTransportIds() != null && !df.getTransportIds().isEmpty()) {
            transportId = df.getTransportIds().get(0);
        } else {
            transportId = bindingID;
        }
               
        Object config = null;
View Full Code Here

Examples of org.apache.cxf.transport.DestinationFactory

    public EndpointInfo buildEndpoint(ServiceInfo service, BindingInfo bi, Port port) {
        List elements = port.getExtensibilityElements();
        String ns = null;

        DestinationFactory factory = null;
        EndpointInfo ei = null;

        if (null != elements && elements.size() > 0) {
            for (ExtensibilityElement el : CastUtils.cast(elements, ExtensibilityElement.class)) {
                ns = el.getElementType().getNamespaceURI();
View Full Code Here

Examples of org.apache.cxf.transport.DestinationFactory

     */
    private Destination getDestination(String address) throws IOException {
        Destination destination = null;
        DestinationFactoryManager factoryManager =
            bus.getExtension(DestinationFactoryManager.class);
        DestinationFactory factory =
            factoryManager.getDestinationFactoryForUri(address);
        if (factory != null) {
            EndpointInfo ei = new EndpointInfo();
            ei.setAddress(address);
            destination = factory.getDestination(ei);
            decoupledObserver = new InterposedMessageObserver();
            destination.setMessageObserver(decoupledObserver);
        }
        return destination;
    }
View Full Code Here

Examples of org.apache.cxf.transport.DestinationFactory

       
        Bus bus = (Bus) ctx.getBean(Bus.DEFAULT_BUS_ID);
        bus.setExtension(cfg, Configurer.class);
       
        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
        DestinationFactory factory = dfm.getDestinationFactory("http://schemas.xmlsoap.org/soap/http");
        Destination d = factory.getDestination(info);
        assertTrue(d instanceof JettyHTTPDestination);
        JettyHTTPDestination jd = (JettyHTTPDestination) d;       
        assertEquals("foobar", jd.getServer().getContentEncoding());  
       
        JettyHTTPServerEngine engine = (JettyHTTPServerEngine)jd.getEngine();
        assertEquals(111, engine.getThreadingParameters().getMinThreads());
        assertEquals(120, engine.getThreadingParameters().getMaxThreads());
       
        ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
        ConduitInitiator ci = cim.getConduitInitiator("http://schemas.xmlsoap.org/soap/http");
        HTTPConduit conduit = (HTTPConduit) ci.getConduit(info);
        assertEquals(97, conduit.getClient().getConnectionTimeout());
       
        info.setName(new QName("urn:test:ns", "Bar"));
        conduit = (HTTPConduit) ci.getConduit(info);
        assertEquals(79, conduit.getClient().getConnectionTimeout());

        JettyHTTPDestination jd2 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("foo", "bar", "http://localhost:9001"));
       
        engine = (JettyHTTPServerEngine)jd2.getEngine();
        assertEquals(99, engine.getThreadingParameters().getMinThreads());
        assertEquals(777, engine.getThreadingParameters().getMaxThreads());
        assertTrue("The engine should support session manager", engine.isSessionSupport());
        assertNotNull("The handlers should not be null", engine.getHandlers());
        assertEquals(1, engine.getHandlers().size());
        assertTrue("The connector should be instance of org.mortbay.jetty.bio.SocketConnector",
                   engine.getConnector() instanceof org.mortbay.jetty.bio.SocketConnector);
       
        JettyHTTPDestination jd3 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo", "https://localhost:9002"));
       
        engine = (JettyHTTPServerEngine)jd3.getEngine();
        assertEquals(111, engine.getThreadingParameters().getMinThreads());
        assertEquals(120, engine.getThreadingParameters().getMaxThreads());
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), true);
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), true);
       
        JettyHTTPDestination jd4 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo2", "https://localhost:9003"));
       
        engine = (JettyHTTPServerEngine)jd4.getEngine();
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), false);
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), false);

        JettyHTTPDestination jd5 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo", "http://localhost:9100"));
       
        engine = (JettyHTTPServerEngine)jd5.getEngine();
        String r = "expected fallback thread parameters configured for port 0";
        assertNotNull(r, engine.getThreadingParameters());
View Full Code Here

Examples of org.apache.cxf.transport.DestinationFactory

        URL decoupledURL = null;
        if (decoupled) {
            decoupledURL = new URL(NOWHERE + "response");
            DestinationFactoryManager mgr =
                control.createMock(DestinationFactoryManager.class);
            DestinationFactory factory =
                control.createMock(DestinationFactory.class);
            Destination destination =
                control.createMock(Destination.class);

            bus.setExtension(mgr, DestinationFactoryManager.class);
            mgr.getDestinationFactoryForUri(decoupledURL.toString());
            EasyMock.expectLastCall().andReturn(factory);
            factory.getDestination(EasyMock.isA(EndpointInfo.class));
            EasyMock.expectLastCall().andReturn(destination);
            destination.setMessageObserver(EasyMock.isA(HTTPConduit.InterposedMessageObserver.class));
        }
       
        control.replay();
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.