Package org.apache.cxf.endpoint

Examples of org.apache.cxf.endpoint.ServerRegistry


    @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

        }
        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

        }
        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();
            }
        }
        String localString = "local://" + string;
        for (Server s : svrMan.getServers()) {
            String s2 = s.getDestination().getAddress().getAddress().getValue();
            if (localString.equals(s2)) {
                Service svc = s.getEndpoint().getService();
                ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, svc.getServiceInfos());
                return builder.build();
View Full Code Here

    @Test
    public void testUpDownWithServlets() throws Exception {       
        setUpBus(true);
      
        Bus bus = (Bus)applicationContext.getBean("cxf");
        ServerRegistry sr = bus.getExtension(ServerRegistry.class);
        ServerImpl si = (ServerImpl) sr.getServers().get(0);
        JettyHTTPDestination jhd = (JettyHTTPDestination) si.getDestination();
        JettyHTTPServerEngine e = (JettyHTTPServerEngine) jhd.getEngine();
        org.eclipse.jetty.server.Server jettyServer = e.getServer();

        Handler[] contexts = jettyServer.getChildHandlersByClass(WebAppContext.class);
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

        sf.getServiceFactory().setDataBinding(new AegisDatabinding());
    }
   

    protected Document getWSDLDocument(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(svc.getServiceInfos());
                Definition definition = builder.build();
               
View Full Code Here

            throw new RuntimeException("Failed to write javascript utils to HTTP response.", e);
        }
    }
   
    private Endpoint findEndpoint(EndpointInfo endpointInfo) {
        ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class);
        for (Server server : serverRegistry.getServers()) {
            // Hypothetically, not all destinations have an endpoint.
            // There has to be a better way to do this.
            if (server.getDestination() instanceof DestinationWithEndpoint
                &&
                endpointInfo.
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.