Package org.apache.cxf.service.model

Examples of org.apache.cxf.service.model.EndpointInfo


    public void testRandomPortAllocation() throws Exception {
        transportFactory = new JettyHTTPTransportFactory();
        transportFactory.setBus(new CXFBusImpl());
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setName(new QName("bla", "Service"));
        EndpointInfo ei = new EndpointInfo(serviceInfo, "");
        ei.setName(new QName("bla", "Port"));
       
        Destination d1 = transportFactory.getDestination(ei);
        URL url = new URL(d1.getAddress().getAddress().getValue());
        assertTrue("No random port has been allocated",
                   url.getPort() > 0);
View Full Code Here


       
        HttpServletRequest httpRequest = EasyMock.createMock(HttpServletRequest.class);
       
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setName(new QName("bla", "Service"));
        EndpointInfo ei = new EndpointInfo(serviceInfo, "");
        ei.setName(new QName("bla", "Port"));
       
        final JettyHTTPServerEngine httpEngine = new JettyHTTPServerEngine();
        httpEngine.setContinuationsEnabled(false);
        JettyHTTPServerEngineFactory factory = new JettyHTTPServerEngineFactory() {
            @Override
View Full Code Here

        transportFactory = new JettyHTTPTransportFactory();
        transportFactory.setBus(new CXFBusImpl());
       
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setName(new QName("bla", "Service"));       
        EndpointInfo ei = new EndpointInfo(serviceInfo, "");
        ei.setName(new QName("bla", "Port"));
        ei.setAddress("http://foo");
        Destination d1 = transportFactory.getDestination(ei);
       
        Destination d2 = transportFactory.getDestination(ei);
        assertEquals(d1, d2);
       
View Full Code Here

        transportFactory = new JettyHTTPTransportFactory();
        transportFactory.setBus(bus);
       
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setName(new QName("bla", "Service"));       
        endpointInfo = new EndpointInfo(serviceInfo, "");
        endpointInfo.setName(new QName("bla", "Port"));
        endpointInfo.addExtensor(policy);
       
        engine = EasyMock.createMock(JettyHTTPServerEngine.class);
        EasyMock.replay();
View Full Code Here

       
       
        engine = EasyMock.createNiceMock(JettyHTTPServerEngine.class);
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setName(new QName("bla", "Service"));       
        endpointInfo = new EndpointInfo(serviceInfo, "");
        endpointInfo.setName(new QName("bla", "Port"));
        endpointInfo.setAddress(NOWHERE + "bar/foo");
      
        endpointInfo.addExtensor(policy);
        engine.addServant(EasyMock.eq(new URL(NOWHERE + "bar/foo")),
View Full Code Here

        if (transportId == null) {
            ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
            ConduitInitiator ci = cim.getConduitInitiatorForUri(location);
            transportId = ci.getTransportIds().get(0);
        }
        EndpointInfo ei = new EndpointInfo(si, transportId);
        ei.setBinding(bi);
        ei.setName(epName == null ? iName : epName);
        ei.setAddress(location);
        si.addEndpoint(ei);
        if (policy != null) {
            ei.addExtensor(policy);
        }
       
        BindingOperationInfo boi = bi.getOperation(ioi);
        SoapOperationInfo soi = boi.getExtensor(SoapOperationInfo.class);
        if (soi == null) {
View Full Code Here

        checkContext(ctx);
    }
    private void checkContext(TestApplicationContext ctx) throws Exception {
        ConfigurerImpl cfg = new ConfigurerImpl(ctx);
       
        EndpointInfo info = getEndpointInfo("bla", "Foo", "http://localhost:9000");
       
        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://cxf.apache.org/transports/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://cxf.apache.org/transports/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(
View Full Code Here

    private EndpointInfo getEndpointInfo(String serviceNS,
                                         String endpointLocal,
                                         String address) {
        ServiceInfo serviceInfo2 = new ServiceInfo();
        serviceInfo2.setName(new QName(serviceNS, "Service"));       
        EndpointInfo info2 = new EndpointInfo(serviceInfo2, "");
        info2.setName(new QName("urn:test:ns", endpointLocal));
        info2.setAddress(address);
        return info2;
    }
View Full Code Here

        ConduitSelector cs = new DeferredConduitSelector() {
            @Override
            public synchronized Conduit selectConduit(Message message) {
                Conduit conduit = null;
                EndpointInfo endpointInfo = reliableEndpoint.getEndpointInfo();
                org.apache.cxf.ws.addressing.EndpointReferenceType original =
                    endpointInfo.getTarget();
                try {
                    if (null != address) {
                        endpointInfo.setAddress(address);
                    }
                    conduit = super.selectConduit(message);
                } finally {
                    endpointInfo.setAddress(original);
                }
                return conduit;
            }
        };
       
View Full Code Here

        }
        return null;
    }
   
    protected final Map<Object, Crypto> getCryptoCache() {
        EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
        synchronized (info) {
            Map<Object, Crypto> o = CastUtils.cast((Map<?, ?>)message.getContextualProperty(CRYPTO_CACHE));
            if (o == null) {
                o = new ConcurrentHashMap<Object, Crypto>();
                info.setProperty(CRYPTO_CACHE, o);
            }
            return o;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.service.model.EndpointInfo

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.