Package org.apache.tomee.installer

Examples of org.apache.tomee.installer.Installer


        }
    }

    public List<Map<String, String>> execute() {
        final Paths paths = new Paths(openejbWarDir);
        final Installer installer = new Installer(paths);
        final List<Map<String, String>> result = new ArrayList<Map<String, String>>();
        if (org.apache.tomee.installer.Status.NONE.equals(installer.getStatus())) {
            paths.reset();
            installer.reset();
            paths.setCatalinaHomeDir(this.catalinaHome);
            paths.setCatalinaBaseDir(this.catalinaBase);
            paths.setServerXmlFile(this.serverXmlFile);
            if (paths.verify()) {
                installer.installAll();
            }
        }
        result.add(Common.build("status", String.valueOf(installer.getStatus())));
        setAlerts("errors", installer.getAlerts().getErrors(), result);
        setAlerts("warnings", installer.getAlerts().getWarnings(), result);
        setAlerts("infos", installer.getAlerts().getInfos(), result);
        {
            boolean hasHome = false;
            boolean doesHomeExist = false;
            boolean isHomeDirectory = false;
            boolean hasLibDirectory = false;
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)) {
                Map<Object, Object> map = new TreeMap<Object, Object>(System.getProperties());
                for (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() + ":" + configuration.getHttpPort() + "/tomee/installer";

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

                final RemoteServer tmpContainer = new RemoteServer();
                tmpContainer.start();

                final URL url = new URL(baseUrl);
View Full Code Here

        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() != Status.INSTALLED) {
                    installer.installConfigFiles();
                }
            }
        }

        // Not thread safe
View Full Code Here

        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

        File openejbWarDir = null;
        if (path != null) {
            openejbWarDir = new File(path);
        }
        final Paths paths = new Paths(openejbWarDir);
        final Installer installer = new Installer(paths);

        final Map<String, Object> json = new HashMap<String, Object>();

        if (Installer.Status.NONE.equals(installer.getStatus())) {
            paths.reset();
            installer.reset();

            if (Boolean.valueOf(String.valueOf(params.get("auto")))) {
                paths.setCatalinaHomeDir(System.getProperty("catalina.home"));
                paths.setCatalinaBaseDir(System.getProperty("catalina.base"));
                paths.setServerXmlFile(System.getProperty("catalina.base") + "/conf/server.xml");
            } else {
                paths.setCatalinaHomeDir((String) params.get("catalina-home"));
                paths.setCatalinaBaseDir((String) params.get("catalina-base"));
                paths.setServerXmlFile((String) params.get("catalina-server-xml"));
            }

            if (paths.verify()) {
                installer.installAll();
            }
        }
        json.put("status", installer.getStatus());
        json.put("errors", installer.getAlerts().getErrors());
        json.put("warnings", installer.getAlerts().getWarnings());
        json.put("infos", installer.getAlerts().getInfos());

        final Map<String, Object> test = new HashMap<String, Object>();
        json.put("tests", test);

        {
View Full Code Here

        strMainPaths.put("catalina-server-xml", getSafePath(paths.getServerXmlFile()));

        json.put("paths", strPaths);
        json.put("mainPaths", strMainPaths);

        final Installer installer = new Installer(paths);
        json.put("installerStatus", installer.getStatus());
        return json;
    }
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", "{appId}/{ejbJarId}/{ejbName}");

                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);
            }

            if (logger.isLoggable(Level.FINE)) {
                Map<Object, Object> map = new TreeMap<Object, Object>(System.getProperties());
                for (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
                String baseUrl = "http://" + configuration.getHost() + ":" + configuration.getHttpPort() + "/tomee/installer";

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

                RemoteServer tmpContainer = new RemoteServer();
                tmpContainer.start();

                URL url = new URL(baseUrl);
View Full Code Here

        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("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

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.