Package org.apache.tomee.embedded

Examples of org.apache.tomee.embedded.Container$TomcatWithFastSessionIDs


        return EmbeddedTomEEConfiguration.class;
    }

    public void setup(EmbeddedTomEEConfiguration configuration) {
        super.setup(configuration);
        container = new Container();
        container.setup(convertConfiguration(configuration));
    }
View Full Code Here


    private Exception exception;
    private final Container container;

    public ContainersImpl() {
        System.out.println("Initialized ContainersImpl " + (++count));
        container = new Container();
        System.setProperty("tomee.valves", ResetStaticValve.class.getName());
    }
View Full Code Here

    }

    public void setup(TomEEConfiguration configuration) {
        this.configuration = configuration;
        setSystemProperties();
        container = new Container();
        container.setup(convertConfiguration(configuration));
    }
View Full Code Here

    private static final Map<String, File> FILES = new ConcurrentHashMap<String, File>();

    public ContainersImpl() {
        System.out.println("Initialized ContainersImpl " + (++count));
        container = new Container();
        System.setProperty("tomee.valves", ResetStaticValve.class.getName());
    }
View Full Code Here

    private static final Map<String, File> FILES = new ConcurrentHashMap<String, File>();

    public ContainersImpl() {
        System.out.println("Initialized ContainersImpl " + (++count));
        container = new Container();
        System.setProperty("tomee.valves", ResetStaticValve.class.getName());
    }
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);
        }
View Full Code Here

    }

    @Override
    public void setup(final EmbeddedTomEEConfiguration configuration) {
        super.setup(configuration);
        this.container = new Container();
        this.container.setup(this.convertConfiguration(configuration));
    }
View Full Code Here

    }

    @Override
    public void setup(final EmbeddedTomEEConfiguration configuration) {
        super.setup(configuration);
        this.container = new Container();
        this.container.setup(this.convertConfiguration(configuration));
    }
View Full Code Here

        if (mavenLog) {
            System.setProperty("openejb.log.factory", MavenLogStreamFactory.class.getName()); // this line also preload the class (<cinit>)
            System.setProperty("openejb.jul.forceReload", "true");
        }

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

        final Thread hook = new Thread() {
            @Override
            public void run() {
                if (container.getTomcat() != null && container.getTomcat().getServer().getState() != LifecycleState.DESTROYED) {
                    try {
                        if (!classpathAsWar) {
                            container.undeploy(warFile.getAbsolutePath());
                        }
                        container.stop();
                    } catch (final Exception e) {
                        getLog().error("can't stop TomEE", e);
                    }
                }
            }
        };

        try {
            container.start();
            SystemInstance.get().setComponent(ParentClassLoaderFinder.class, new ProvidedClassLoaderFinder(loader));

            Runtime.getRuntime().addShutdownHook(hook);

            if (!classpathAsWar) {
                container.deploy('/' + (context == null ? warFile.getName() : context), warFile, true);
            } else {
                if (useProjectClasspath) {
                    thread.setContextClassLoader(createClassLoader(loader));
                }
                container.deployClasspathAsWebApp(context, docBase); // null is handled properly so no issue here
            }

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

        try {
            String line;
            final Scanner scanner = new Scanner(System.in);
            while ((line = scanner.nextLine()) != null) {
                switch (line.trim()) {
                    case "exit":
                    case "quit":
                        Runtime.getRuntime().removeShutdownHook(hook);
                        container.close();
                        return;
                }
            }
        } catch (final Exception e) {
            Thread.interrupted();
View Full Code Here

    }

    @Override
    public void setup(final EmbeddedTomEEConfiguration configuration) {
        super.setup(configuration);
        this.container = new Container();
        this.container.setup(this.convertConfiguration(configuration));
    }
View Full Code Here

TOP

Related Classes of org.apache.tomee.embedded.Container$TomcatWithFastSessionIDs

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.