Package org.apache.openejb.server

Examples of org.apache.openejb.server.SimpleServiceManager$ServiceFinder


    }

    @Test
    public void test() throws Exception {
        final int port = NetworkUtil.getNextAvailablePort();
        final SimpleServiceManager serviceManager = new SimpleServiceManager(new ServiceFinder() {
            @Override
            public Map<String, Properties> mapAvailableServices(final Class interfase) throws IOException, ClassNotFoundException {
                final Properties properties = new Properties();
                properties.setProperty("server", DerbyNetworkService.class.getName());
                properties.setProperty("port", port + "");
                properties.setProperty("disabled", "false");
                properties.put(ServerService.class, DerbyNetworkService.class);
                properties.put(
                    "derby.system.home",
                    new File(SystemInstance.get().getBase().getDirectory(), "target").getAbsolutePath()
                );
                final Map<String, Properties> services = new HashMap<String, Properties>();
                services.put("derbynet", properties);
                return services;
            }
        });
        serviceManager.init();
        serviceManager.start(false);
        waitForDerby(port);
        assertConnection(port);
        serviceManager.stop();
    }
View Full Code Here


    }

    @Test
    public void test() throws Exception {
        final int port = NetworkUtil.getNextAvailablePort();
        final SimpleServiceManager serviceManager = new SimpleServiceManager(new ServiceFinder() {
            @Override
            public Map<String, Properties> mapAvailableServices(Class interfase) throws IOException, ClassNotFoundException {
                final Properties properties = new Properties();
                properties.setProperty("server", DerbyNetworkService.class.getName());
                properties.setProperty("port", port + "");
                properties.setProperty("disabled", "false");
                properties.put(ServerService.class, DerbyNetworkService.class);
                properties.put(
                    "derby.system.home",
                    new File(SystemInstance.get().getBase().getDirectory(), "target").getAbsolutePath()
                );
                final Map<String, Properties> services = new HashMap<String, Properties>();
                services.put("derbynet", properties);
                return services;
            }
        });
        serviceManager.init();
        serviceManager.start(false);
        waitForDerby(port);
        assertConnection(port);
        serviceManager.stop();
    }
View Full Code Here

    @Test
    public void test() throws Exception {
        final int port = NetworkUtil.getNextAvailablePort();

        final SimpleServiceManager serviceManager = new SimpleServiceManager(new ServiceFinder() {
            @Override
            public Map<String, Properties> mapAvailableServices(Class interfase) throws IOException, ClassNotFoundException {
                final Properties properties = new Properties();
                properties.setProperty("server", DerbyNetworkService.class.getName());
                properties.setProperty("port", port + "");
                properties.setProperty("disabled", "false");
                properties.put(ServerService.class, DerbyNetworkService.class);
                final Map<String, Properties> services = new HashMap<String, Properties>();
                services.put("derbynet", properties);
                return services;
            }
        });

        serviceManager.init();
        serviceManager.start(false);

        final Socket derbyClient = new Socket("localhost", port);

        serviceManager.stop();
    }
View Full Code Here

        if (!(sm instanceof SimpleServiceManager)) { // we don't know
            LOGGER.warning("the service manager used is not a simple service manager so rest services can't be retrieved");
            return null;
        }

        final SimpleServiceManager ssm = (SimpleServiceManager) sm;
        final ServerService[] serverServices = ssm.getDaemons();
        if (serverServices == null) {
            LOGGER.warning("no service started");
            return null;
        }
View Full Code Here

    @Test
    public void test() throws Exception {
        final int port = NetworkUtil.getNextAvailablePort();

        final SimpleServiceManager serviceManager = new SimpleServiceManager(new ServiceFinder() {
            @Override
            public Map<String, Properties> mapAvailableServices(Class interfase) throws IOException, ClassNotFoundException {
                final Properties properties = new Properties();
                properties.setProperty("server", DerbyNetworkService.class.getName());
                properties.setProperty("port", port + "");
                properties.setProperty("disabled", "false");
                properties.put(ServerService.class, DerbyNetworkService.class);
                Map<String, Properties> services = new HashMap<String, Properties>();
                services.put("derbynet", properties);
                return services;
            }
        });

        serviceManager.init();
        serviceManager.start(false);

        final Socket derbyClient = new Socket("localhost", port);

        serviceManager.stop();
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.server.SimpleServiceManager$ServiceFinder

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.