Package org.apache.cxf.endpoint

Examples of org.apache.cxf.endpoint.ServerRegistry


        }
        return docs;
    }

    protected Definition getWSDLDefinition(String string) throws WSDLException {
        ServerRegistry svrMan = getBus().getExtension(ServerRegistry.class);
        for (Server s : svrMan.getServers()) {
            Service svc = s.getEndpoint().getService();
            if (svc.getName().getLocalPart().equals(string)) {
                ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, svc.getServiceInfos());
                return builder.build();
            }
View Full Code Here


   
   
    private static MultiplexDestination getMatchingMultiplexDestination(QName serviceQName, String portName,
                                                                        Bus bus) {
        MultiplexDestination destination = null;
        ServerRegistry serverRegistry = (ServerRegistry)bus.getExtension(ServerRegistry.class);
        if (null != serverRegistry) {
            List<Server> servers = serverRegistry.getServers();
            for (Server s : servers) {
                QName targetServiceQName = s.getEndpoint().getEndpointInfo().getService().getName();
                if (serviceQName.equals(targetServiceQName) && portNameMatches(s, portName)) {
                    Destination dest = s.getDestination();
                    if (dest instanceof MultiplexDestination) {
View Full Code Here

        wsdlBuilder.setUseSchemaImports(false);
        return wsdlBuilder.build();
    }

    public Server getServerForService(QName serviceName) throws WSDLException {
        ServerRegistry svrMan = bus.getExtension(ServerRegistry.class);
        for (Server s : svrMan.getServers()) {
            Service svc = s.getEndpoint().getService();
            if (svc.getName().equals(serviceName)) {
                return s;
            }
        }
View Full Code Here

        }
        return null;
    }
   
    public Server getServerForAddress(String address) throws WSDLException {
        ServerRegistry svrMan = bus.getExtension(ServerRegistry.class);
        for (Server s : svrMan.getServers()) {
            if (address.equals(s.getEndpoint().getEndpointInfo().getAddress())) {
                return s;
            }
        }
        return null;
View Full Code Here

        protected void run()  {           
            SpringBusFactory bf = new SpringBusFactory();
            Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/rmwsdl_server.xml");
            BusFactory.setDefaultBus(bus);
           
            ServerRegistry sr = bus.getExtension(ServerRegistry.class);
            PolicyEngine pe = bus.getExtension(PolicyEngine.class);
           
            List<PolicyAssertion> assertions1
                = getAssertions(pe, sr.getServers().get(0));
            assertEquals("2 assertions should be available", 2, assertions1.size());
            List<PolicyAssertion> assertions2 =
                getAssertions(pe, sr.getServers().get(1));
            assertEquals("1 assertion should be available", 1, assertions2.size());
           
            LOG.info("Published greeter endpoints.");
        }
View Full Code Here

            } else {
                busses = Collections.emptyList();
            }
        }
        for (Bus b : busses) {
            ServerRegistry reg = b.getExtension(ServerRegistry.class);
            List<Server> servers = reg.getServers();
            System.out.println(String.format(HEADER_FORMAT,
                                             "Name", "State", "Address", "BusID"));
            for (Server serv : servers) {
                String qname = serv.getEndpoint().getEndpointInfo().getName().getLocalPart();
                String started = serv.isStarted() ? "Started" : "Stopped";
View Full Code Here

    @Test
    public void testColocOutInvalidEndpoint() throws Exception {

        Bus bus = setupBus();
        ServerRegistry sr = control.createMock(ServerRegistry.class);
        EasyMock.expect(bus.getExtension(ServerRegistry.class)).andReturn(sr);

        control.replay();
        try {
            colocOut.handleMessage(msg);
View Full Code Here

    @Test
    public void testColocOutInvalidOperation() throws Exception {

        Bus bus = setupBus();
        ServerRegistry sr = control.createMock(ServerRegistry.class);
        EasyMock.expect(bus.getExtension(ServerRegistry.class)).andReturn(sr);

        Endpoint ep = control.createMock(Endpoint.class);
        ex.put(Endpoint.class, ep);
View Full Code Here

    @Test
    public void testColocOutIsColocatedPropertySet() throws Exception {
        colocOut = new TestColocOutInterceptor1();
       
        Bus bus = setupBus();
        ServerRegistry sr = control.createMock(ServerRegistry.class);
        EasyMock.expect(bus.getExtension(ServerRegistry.class)).andReturn(sr);

        //Funtion Param
        Server s1 = control.createMock(Server.class);
        List<Server> list = new ArrayList<Server>();
        list.add(s1);       
        Endpoint sep = control.createMock(Endpoint.class);
        ex.put(Endpoint.class, sep);
        BindingInfo sbi = control.createMock(BindingInfo.class);
        InterfaceInfo sii = control.createMock(InterfaceInfo.class);
        BindingOperationInfo sboi = control.createMock(BindingOperationInfo.class);
       
        ex.put(BindingOperationInfo.class, sboi);
        //Local var
        Service ses = control.createMock(Service.class);
        EndpointInfo sei = control.createMock(EndpointInfo.class);

        Endpoint rep = control.createMock(Endpoint.class);
        Service res = control.createMock(Service.class);
        BindingInfo rbi = control.createMock(BindingInfo.class);
        EndpointInfo rei = control.createMock(EndpointInfo.class);

        EasyMock.expect(sr.getServers()).andReturn(list);
        EasyMock.expect(sep.getService()).andReturn(ses);
        EasyMock.expect(sep.getEndpointInfo()).andReturn(sei);
        EasyMock.expect(s1.getEndpoint()).andReturn(rep);
        EasyMock.expect(rep.getService()).andReturn(res);
        EasyMock.expect(rep.getEndpointInfo()).andReturn(rei);
View Full Code Here

        Bus bus = BusFactory.getDefaultBus(false);
        if (bus == null) {
            throw new Fault(new org.apache.cxf.common.i18n.Message("BUS_NOT_FOUND", BUNDLE));
        }
       
        ServerRegistry registry = bus.getExtension(ServerRegistry.class);
       
        if (registry == null) {
            throw new Fault(new org.apache.cxf.common.i18n.Message("SERVER_REGISTRY_NOT_FOUND", BUNDLE));
        }
       
        Exchange exchange = message.getExchange();
        Endpoint senderEndpoint = exchange.get(Endpoint.class);

        if (senderEndpoint == null) {
            throw new Fault(new org.apache.cxf.common.i18n.Message("ENDPOINT_NOT_FOUND",
                                                                   BUNDLE));
        }

        BindingOperationInfo boi = exchange.get(BindingOperationInfo.class);
       
        if (boi == null) {
            throw new Fault(new org.apache.cxf.common.i18n.Message("OPERATIONINFO_NOT_FOUND",
                                                                   BUNDLE));
        }

        Server srv = isColocated(registry.getServers(), senderEndpoint, boi);
       
        if (srv != null) {
            if (LOG.isLoggable(Level.FINE)) {
                LOG.fine("Operation:" + boi.getName() + " dispatched as colocated call.");
            }
View Full Code Here

TOP

Related Classes of org.apache.cxf.endpoint.ServerRegistry

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.