Package org.apache.cxf.endpoint

Examples of org.apache.cxf.endpoint.Server


        f.setTransportIds(tp);
        f.setBus(bus);
        f.register();
       
       
        Server s = factory.create();

        try {
            ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus,
                                                                s.getEndpoint().getService()
                                                                    .getServiceInfos());
            Definition def = builder.build();
            WSDLWriter wsdlWriter = bus.getExtension(WSDLManager.class)
                .getWSDLFactory().newWSDLWriter();
            def.setExtensionRegistry(bus.getExtension(WSDLManager.class).getExtensionRegistry());
View Full Code Here


    @Test
    public void testStartServer() throws NoSuchMethodException {
        Method m = RMManager.class.getDeclaredMethod("recoverReliableEndpoint",
            new Class[] {Endpoint.class, Conduit.class, ProtocolVariation.class});
        manager = control.createMock(RMManager.class, new Method[] {m});
        Server s = control.createMock(Server.class);
        Endpoint e = control.createMock(Endpoint.class);
        EasyMock.expect(s.getEndpoint()).andReturn(e);
        manager.recoverReliableEndpoint(e, (Conduit)null, ProtocolVariation.RM10WSA200408);
        EasyMock.expectLastCall();
        control.replay();
        manager.startServer(s);
        control.verify();
View Full Code Here

    @Test
    public void testStopServer() throws NoSuchMethodException {
        Method m = RMManager.class
            .getDeclaredMethod("shutdownReliableEndpoint", new Class[] {Endpoint.class});
        manager = control.createMock(RMManager.class, new Method[] {m});
        Server s = control.createMock(Server.class);
        Endpoint e = control.createMock(Endpoint.class);
        EasyMock.expect(s.getEndpoint()).andReturn(e);
        manager.shutdownReliableEndpoint(e);
        EasyMock.expectLastCall();
        control.replay();
        manager.stopServer(s);
        control.verify();
View Full Code Here

                if (loader != null) {
                    orig = ClassLoaderUtils.setThreadContextClassloader(loader);
                }
            }

            Server server = super.create();
            initializeResourcesAndHandlerChain();
            checkPrivateEndpoint(server.getEndpoint());
           
            return server;
        } finally {
            if (orig != null) {
                orig.reset();
View Full Code Here

        factory.setInvoker(invoker);


        // create and start the server
        factory.setStart(true);
        Server server = factory.create();

        // save the server for clean up later
        endpoints.put(spec.getDisplayName(), new InboundEndpoint(server, invoker));
    }
View Full Code Here

    public void testBasicInvocation() throws Exception {

        Thread.currentThread().setContextClassLoader(JAXRSClientFactoryBean.class.getClassLoader());
        bundleContext.registerService(new String[]{"javax.ws.rs.ext.MessageBodyReader"},
           new AegisElementProvider(), new Hashtable());
        Server server1 = null;
        Server server2 = null;
        ServiceTracker tracker = null;
        try {
            server1 = startServer(ADDRESS1,
                                  GreeterService.class, new GreeterServiceImpl());
           
            server2 = startServer(ADDRESS2,
                                  GreeterService.class, new GreeterServiceImpl());
            tracker = new ServiceTracker(bundleContext,
                                         GreeterService.class.getName(), null) {
                @Override
                public Object addingService(final ServiceReference reference) {
                    Object result = super.addingService(reference);

                    FutureTask<GreeterInfo> future =
                        new FutureTask<GreeterInfo>(new Callable<GreeterInfo>() {
                          public GreeterInfo call() {
                            return useService(reference);
                        }});
                    future.run();
                    synchronized (mutex1) {
                        synchronized (mutex2) {
                            if (task1 == null) {
                                task1 = future;
                                mutex1.notify();
                            } else if (task2 == null) {
                                task2 = future;
                                mutex2.notify();
                            }
                        }
                    }
                    return result;
                }
            };
            tracker.open();
            // sleep for a bit
            Thread.sleep(2000);
           
            installDswIfNeeded();

            verifyGreeterResponse(task1, mutex1);
            verifyGreeterResponse(task2, mutex2);
        } finally {
            if (tracker != null) {
                tracker.close();
            }
           
            if (server1 != null) {
                server1.getDestination().shutdown();
                server1.stop();
            }

            if (server2 != null) {
                server2.getDestination().shutdown();
                server2.stop();
            }
           
        }
    }
View Full Code Here

    public void testBasicInvocation() throws Exception {

        Thread.currentThread().setContextClassLoader(ClientProxyFactoryBean.class.getClassLoader());

        Server server1 = null;
        Server server2 = null;
        ServiceTracker tracker = null;
        try {
            server1 = startServer(ADDRESS1,
                                  GreeterService.class, new GreeterServiceImpl());
           
            server2 = startServer(ADDRESS2,
                                  GreeterService.class, new GreeterServiceImpl());
            tracker = new ServiceTracker(bundleContext,
                                         GreeterService.class.getName(), null) {
                @Override
                public Object addingService(final ServiceReference reference) {
                    Object result = super.addingService(reference);

                    FutureTask<Map<GreetingPhrase, String>> future =
                        new FutureTask<Map<GreetingPhrase, String>>(new Callable<Map<GreetingPhrase, String>>() {
                          public Map<GreetingPhrase, String> call() {
                            return useService(reference);
                        }});
                    future.run();
                    synchronized (mutex1) {
                        synchronized (mutex2) {
                            if (task1 == null) {
                                task1 = future;
                                mutex1.notify();
                            } else if (task2 == null) {
                                task2 = future;
                                mutex2.notify();
                            }
                        }
                    }
                    return result;
                }
            };
            tracker.open();
            // sleep for a bit
            Thread.sleep(2000);
           
            installDswIfNeeded();

            verifyGreeterResponse(task1, mutex1);
            verifyGreeterResponse(task2, mutex2);
        } finally {
            if (tracker != null) {
                tracker.close();
            }
           
            if (server1 != null) {
                server1.getDestination().shutdown();
                server1.stop();
            }

            if (server2 != null) {
                server2.getDestination().shutdown();
                server2.stop();
            }
           
        }
    }
View Full Code Here

        ServerFactoryBean factory = new ServerFactoryBean();
        factory.setServiceClass(type);
        factory.setAddress(address);
        factory.getServiceFactory().setDataBinding(new AegisDatabinding());
        factory.setServiceBean(impl);
        Server server = factory.create();
        server.start();
        return server;
    }
View Full Code Here

            }, address,intents);
            EndpointDescription endpdDesc = null;
           
           
            Thread.currentThread().setContextClassLoader(JAXRSServerFactoryBean.class.getClassLoader());
            Server server = factory.create();
            registerStopHook(bus, httpService, server, contextRoot, Constants.RS_HTTP_SERVICE_CONTEXT);

            endpdDesc = new EndpointDescription(endpointProps);
            exportRegistration.setServer(server);
           
View Full Code Here

        EasyMock.replay(sf);
       
        final StringBuilder serverURI = new StringBuilder();
       
        ServerFactoryBean sfb = EasyMock.createNiceMock(ServerFactoryBean.class);
        Server server = createMockServer(sfb);   
       
        EasyMock.expect(sfb.getServiceFactory()).andReturn(sf).anyTimes();
        EasyMock.expect(sfb.create()).andReturn(server);
        sfb.setAddress((String) EasyMock.anyObject());
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
View Full Code Here

TOP

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

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.