Package org.apache.tomee.embedded

Examples of org.apache.tomee.embedded.Configuration


        final CountDownLatch latch = new CountDownLatch(1);

        System.setProperty("openejb.log.factory", "org.apache.openejb.maven.util.MavenLogStreamFactory");

        final Container container = new Container();
        final Configuration config  = getConfig();
        container.setup(config);
        try {
            container.start();

            Runtime.getRuntime().addShutdownHook(new Thread() {
                @Override
                public void run() {
                    try {
                        container.undeploy(warFile.getAbsolutePath());
                        container.stop();
                    } catch (Exception e) {
                        getLog().error("can't stop TomEE", e);
                    } finally {
                        latch.countDown();
                    }
                }
            });

            container.deploy(warFile.getName(), warFile);

            getLog().info("TomEE embedded started on " + config.getHost() + ":" + config.getHttpPort());
        } catch (Exception e) {
            getLog().error("can't start TomEE", e);
        }

        try {
View Full Code Here


            System.clearProperty("openejb.log.factory");
        }
    }

    private Configuration getConfig() { // lazy way but it works fine
        final Configuration config = new Configuration();
        for (Field field : getClass().getDeclaredFields()) {
            try {
                final Field configField = Configuration.class.getDeclaredField(field.getName());
                field.setAccessible(true);
                configField.setAccessible(true);
View Full Code Here

        final CountDownLatch latch = new CountDownLatch(1);

        System.setProperty("openejb.log.factory", "org.apache.openejb.maven.util.MavenLogStreamFactory");

        final Container container = new Container();
        final Configuration config  = getConfig();
        container.setup(config);
        try {
            container.start();

            Runtime.getRuntime().addShutdownHook(new Thread() {
                @Override
                public void run() {
                    try {
                        container.undeploy(warFile.getAbsolutePath());
                        container.stop();
                    } catch (Exception e) {
                        getLog().error("can't stop TomEE", e);
                    } finally {
                        latch.countDown();
                    }
                }
            });

            container.deploy(warFile.getName(), warFile);

            getLog().info("TomEE embedded started on " + config.getHost() + ":" + config.getHttpPort());
        } catch (Exception e) {
            getLog().error("can't start TomEE", e);
        }

        try {
View Full Code Here

            System.clearProperty("openejb.log.factory");
        }
    }

    private Configuration getConfig() { // lazy way but it works fine
        final Configuration config = new Configuration();
        for (Field field : getClass().getDeclaredFields()) {
            try {
                final Field configField = Configuration.class.getDeclaredField(field.getName());
                field.setAccessible(true);
                configField.setAccessible(true);
View Full Code Here

    /*
     * Not exactly as elegant as I'd like. Maybe we could have the EmbeddedServer configuration in openejb-core so all the adapters can use it.
     * Depending on tomee-embedded is fine in this adapter, but less desirable in the others, as we'd get loads of stuff in the classpath we don't need.
     */
    private Configuration convertConfiguration(final EmbeddedTomEEConfiguration tomeeConfiguration) {
      final Configuration configuration = new Configuration();
      configuration.setDir(tomeeConfiguration.getDir());
      configuration.setHttpPort(tomeeConfiguration.getHttpPort());
      configuration.setStopPort(tomeeConfiguration.getStopPort());
        configuration.setHost(tomeeConfiguration.getHost());
        configuration.setServerXml(tomeeConfiguration.getServerXml());
        configuration.setProperties(tomeeConfiguration.systemPropertiesAsProperties());
        configuration.setQuickSession(tomeeConfiguration.isQuickSession());
    return configuration;
  }
View Full Code Here

TOP

Related Classes of org.apache.tomee.embedded.Configuration

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.