Package org.apache.tomee.installer

Examples of org.apache.tomee.installer.Installer


        String openejbWarDir = properties.getProperty("tomee.war");
        if (openejbWarDir != null) {

            Paths paths = new Paths(new File(openejbWarDir));
            if (paths.verify()) {
                Installer installer = new Installer(paths);
                if (installer.getStatus() != Installer.Status.INSTALLED) {
                    installer.installConfigFiles();
                }
            }
        }

        // Not thread safe
View Full Code Here


                System.setProperty("catalina.base", openejbHome.getAbsolutePath());

                System.setProperty("openejb.deploymentId.format", "{appId}/{ejbJarId}/{ejbName}");

                Paths paths = new Paths(webapp);
                Installer installer = new Installer(paths, true);
                installer.installAll();
            }

            Files.assertDir(openejbHome);
            Files.readable(openejbHome);
            Files.writable(openejbHome);
View Full Code Here

        String openejbWarDir = properties.getProperty("openejb.war");
        if (openejbWarDir != null) {

            Paths paths = new Paths(new File(openejbWarDir));
            if (paths.verify()) {
                Installer installer = new Installer(paths);
                if (installer.getStatus() != Installer.Status.INSTALLED) {
                    installer.installConfigFiles();
                }
            }
        }

        // Not thread safe
View Full Code Here

    @Override
    protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
        final ServletContext ctx = req.getServletContext();
        final String rootPath = ctx.getRealPath("/");
        final Runner installer = new Runner(new Installer(new Paths(new File(rootPath))));
        resp.setContentType("application/json");
        resp.getOutputStream().print(getJsonList(installer.execute(false)));
    }
View Full Code Here

    @Override
    protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
        final ServletContext ctx = req.getServletContext();
        final String rootPath = ctx.getRealPath("/");
        final Runner installer = new Runner(new Installer(new Paths(new File(rootPath))));
        if (req.getParameter("catalinaBaseDir") != null && "".equals(req.getParameter("catalinaBaseDir").trim())) {
            installer.setCatalinaBaseDir(req.getParameter("catalinaBaseDir").trim());
        }
        if (req.getParameter("catalinaHome") != null && "".equals(req.getParameter("catalinaHome").trim())) {
            installer.setCatalinaHome(req.getParameter("catalinaHome").trim());
View Full Code Here

            Files.readable(workingDirectory);
            Files.writable(workingDirectory);

            openejbHome = Setup.findHome(workingDirectory);
            Installer installer = null;

            if (openejbHome == null) {

                downloadTomcat(workingDirectory, configuration.getTomcatVersion());

                openejbHome = Setup.findHome(workingDirectory);

                Files.deleteOnExit(openejbHome);

                final File webapp = new File(openejbHome, "webapps" + s + "tomee");

                Files.mkdir(webapp);
                downloadOpenEJBWebapp(webapp);

                System.setProperty("catalina.home", openejbHome.getAbsolutePath());
                System.setProperty("catalina.base", openejbHome.getAbsolutePath());

                System.setProperty("openejb.deploymentId.format", System.getProperty("openejb.deploymentId.format", "{appId}/{ejbJarId}/{ejbName}"));

                final Paths paths = new Paths(webapp);
                installer = new Installer(paths, true);
                if (!configuration.isUseInstallerServlet()) {
                    installer.installAll();

                }

                wereOpenejbHomeSet = false;
            }

            Files.assertDir(openejbHome);
            Files.readable(openejbHome);
            Files.writable(openejbHome);

            Setup.configureServerXml(openejbHome, configuration);
            Setup.configureSystemProperties(openejbHome, configuration);

            Setup.exportProperties(openejbHome, configuration, true);

            final URL logging = Thread.currentThread().getContextClassLoader().getResource("default.remote.logging.properties");
            if (logging != null) {
                write(logging, new File(openejbHome, "conf" + s + "logging.properties"));
            }

            if (configuration.isRemoveUnusedWebapps()) {
                Setup.removeUselessWebapps(openejbHome, "tomee");
            }

            if (logger.isLoggable(Level.FINE)) {
                final Map<Object, Object> map = new TreeMap<Object, Object>(System.getProperties());
                for (final Map.Entry<Object, Object> entry : map.entrySet()) {
                    System.out.printf("%s = %s\n", entry.getKey(), entry.getValue());
                }
            }

            Setup.installArquillianBeanDiscoverer(openejbHome);

            if (!wereOpenejbHomeSet && configuration.isUseInstallerServlet()) {
                // instead of calling the Installer, let's just do like users do
                // call the servlet installer instead
                final String baseUrl = "http://" + configuration.getHost() + ":" + httpPort + "/tomee/installer";

                assert installer != null;
                installer.addTomEEAdminConfInTomcatUsers(true);

                final RemoteServer tmpContainer = new RemoteServer();
                tmpContainer.setPortStartup(httpPort);
                tmpContainer.start();
View Full Code Here

        final String openejbWarDir = properties.getProperty("tomee.war");
        if (openejbWarDir != null) {

            final Paths paths = new Paths(new File(openejbWarDir));
            if (paths.verify()) {
                final Installer installer = new Installer(paths);
                if (installer.getStatus() != Status.INSTALLED) {
                    installer.installConfigFiles();
                }
            }
        }

        // Not thread safe
View Full Code Here

            Files.readable(workingDirectory);
            Files.writable(workingDirectory);

            openejbHome = Setup.findHome(workingDirectory);
            Installer installer = null;

            if (openejbHome == null) {

                downloadTomcat(workingDirectory, configuration.getTomcatVersion());

                openejbHome = Setup.findHome(workingDirectory);

                Files.deleteOnExit(openejbHome);

                final File webapp = new File(openejbHome, "webapps" + s + "tomee");

                Files.mkdir(webapp);
                downloadOpenEJBWebapp(webapp);

                System.setProperty("catalina.home", openejbHome.getAbsolutePath());
                System.setProperty("catalina.base", openejbHome.getAbsolutePath());

                System.setProperty("openejb.deploymentId.format", System.getProperty("openejb.deploymentId.format", "{appId}/{ejbJarId}/{ejbName}"));

                final Paths paths = new Paths(webapp);
                installer = new Installer(paths, true);
                if (!configuration.isUseInstallerServlet()) {
                    installer.installAll();

                }

                wereOpenejbHomeSet = false;
            }

            Files.assertDir(openejbHome);
            Files.readable(openejbHome);
            Files.writable(openejbHome);

            Setup.configureServerXml(openejbHome, configuration);
            Setup.configureSystemProperties(openejbHome, configuration);

            Setup.exportProperties(openejbHome, configuration, true);

            final URL logging = Thread.currentThread().getContextClassLoader().getResource("default.remote.logging.properties");
            if (logging != null) {
                write(logging, new File(openejbHome, "conf" + s + "logging.properties"));
            }

            if (configuration.isRemoveUnusedWebapps()) {
                Setup.removeUselessWebapps(openejbHome, "tomee");
            }

            if (logger.isLoggable(Level.FINE)) {
                final Map<Object, Object> map = new TreeMap<>(System.getProperties());
                for (final Map.Entry<Object, Object> entry : map.entrySet()) {
                    System.out.printf("%s = %s\n", entry.getKey(), entry.getValue());
                }
            }

            Setup.installArquillianBeanDiscoverer(openejbHome);

            if (!wereOpenejbHomeSet && configuration.isUseInstallerServlet()) {
                // instead of calling the Installer, let's just do like users do
                // call the servlet installer instead
                final String baseUrl = "http://" + configuration.getHost() + ":" + httpPort + "/tomee/installer";

                assert installer != null;
                installer.addTomEEAdminConfInTomcatUsers(true);

                final RemoteServer tmpContainer = new RemoteServer();
                tmpContainer.setPortStartup(httpPort);
                tmpContainer.start();
View Full Code Here

        final String openejbWarDir = properties.getProperty("tomee.war");
        if (openejbWarDir != null) {

            final Paths paths = new Paths(new File(openejbWarDir));
            if (paths.verify()) {
                final Installer installer = new Installer(paths);
                if (installer.getStatus() != Status.INSTALLED) {
                    installer.installConfigFiles(false);
                }
            }
        }

        // Not thread safe
View Full Code Here

    }

    public List<Map<String, String>> get() {
        final Paths paths = new Paths(openejbWarDir);
        final List<Map<String, String>> result = new ArrayList<Map<String, String>>();
        final Installer installer = new Installer(paths);
        result.add(Common.build("status", String.valueOf(installer.getStatus())));
        result.add(Common.build("isListenerInstalled", String.valueOf(Installer.isListenerInstalled())));
        result.add(Common.build("isAgentInstalled", String.valueOf(Installer.isAgentInstalled())));
        result.add(Common.build("catalinaConfDir", getSafePath(paths.getCatalinaConfDir())));
        result.add(Common.build("catalinaLibDir", getSafePath(paths.getCatalinaLibDir())));
        result.add(Common.build("catalinaBinDir", getSafePath(paths.getCatalinaBinDir())));
View Full Code Here

TOP

Related Classes of org.apache.tomee.installer.Installer

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.