Package org.apache.cxf.endpoint

Examples of org.apache.cxf.endpoint.Server


   
    public static void unregisterServer(ServiceRegistration publication,
                                        EndpointInfo ei) {
       
        try {
            Server server = ei.getServer();
           
            LOG.info("Stopping CXF Endpoint at "
                + server.getDestination().getAddress().getAddress().getValue());
            server.getDestination().shutdown();
            server.stop();
        } catch (Exception ex) {
            // continue
        }
       
        if (ei.isPublished()) {
View Full Code Here


            String [] intents = applyIntents(
                dswContext, callingContext, factory.getFeatures(), factory, sd);
       
           
            Thread.currentThread().setContextClassLoader(ServerFactoryBean.class.getClassLoader());
            Server server = factory.create();
            getDistributionProvider().addExposedService(serviceReference, registerPublication(server, intents));
            addAddressProperty(sd.getProperties(), address);
            return server;
        } catch (IntentUnsatifiedException iue) {
            getDistributionProvider().intentsUnsatisfied(serviceReference);
View Full Code Here

        try {
            String [] intents =
                applyIntents(dswContext, callingContext, factory.getFeatures(), factory, sd);

            Thread.currentThread().setContextClassLoader(ServerFactoryBean.class.getClassLoader());
            Server server = factory.create();
            getDistributionProvider().addExposedService(serviceReference, registerPublication(server, intents, address));
            addAddressProperty(sd.getProperties(), address);
            return server;
        } catch (IntentUnsatifiedException iue) {
            getDistributionProvider().intentsUnsatisfied(serviceReference);
View Full Code Here

        ServiceEndpointDescription[] flatList =
            OsgiUtils.flattenServiceDescription(sd);
        for (int i = 0; i < publishableInterfaces.length; i++) {   
            boolean isPublished = false;
            Server server = createServer(sref, flatList[i]);
            if (server != null) {
                ServiceRegistration publication =
                    ServiceHookUtils.publish(getContext(), sref, flatList[i]);
                publications.put(sref, publication);
                isPublished = publication != null;
View Full Code Here

                                              serviceRegistrations[i]);
            dswContext.addServiceReference(serviceNames[i], sref);
        }
        dswContext.registerService(serviceNames, serviceObject, serviceProps);
       
        Server server = control.createMock(Server.class);

        String publicationClass = ServicePublication.class.getName();
        ServiceRegistration publicationRegistration =
            control.createMock(ServiceRegistration.class);
        publicationRegistration.unregister();
View Full Code Here

                                              serviceRegistrations[i]);
            dswContext.addServiceReference(serviceNames[i], sref);
        }
        dswContext.registerService(serviceNames, serviceObject, serviceProps);
       
        final Server server = control.createMock(Server.class);       
        control.replay();

        CxfPublishHook hook = new CxfPublishHook(dswContext, null) {
            @Override
            Server createServer(ServiceReference sref, ServiceEndpointDescription sd) {
View Full Code Here

public class ServiceHookUtilsTest extends TestCase {
    public void testCreateServer() {
        IMocksControl control = EasyMock.createNiceControl();
       
        Server srvr = control.createMock(Server.class);
        ServiceReference serviceReference = control.createMock(ServiceReference.class);
        BundleContext dswContext = control.createMock(BundleContext.class);
        BundleContext callingContext = control.createMock(BundleContext.class);
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("java.lang.String");
        Object service = "hi";
View Full Code Here

    }

    public void testNoServerWhenNoInterfaceSpecified() {
        IMocksControl control = EasyMock.createNiceControl();
       
        Server srvr = control.createMock(Server.class);
        ServiceReference serviceReference = control.createMock(ServiceReference.class);
        BundleContext dswContext = control.createMock(BundleContext.class);
        BundleContext callingContext = control.createMock(BundleContext.class);
        ServiceEndpointDescription sd = mockServiceDescription(control, "Foo");
        Object service = "hi";
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

       
        Destination destination = EasyMock.createMock(Destination.class);
        EasyMock.expect(destination.getAddress()).andReturn(er);
        EasyMock.replay(destination);       
               
        Server server = EasyMock.createNiceMock(Server.class);
        EasyMock.expect(server.getDestination()).andReturn(destination);
        EasyMock.replay(server);
        return server;
    }
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.