Package org.apache.tomee.installer

Examples of org.apache.tomee.installer.Paths


        // install conf/openejb.xml and conf/logging.properties files
        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);
                }
            }
View Full Code Here


        }
        return file.getPath();
    }

    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())));
        result.add(Common.build("catalinaShFile", getSafePath(paths.getCatalinaShFile())));
        result.add(Common.build("catalinaBatFile", getSafePath(paths.getCatalinaBatFile())));
        result.add(Common.build("openEJBLibDir", getSafePath(paths.getOpenEJBLibDir())));
        result.add(Common.build("openEJBTomcatLoaderJar", getSafePath(paths.getOpenEJBTomcatLoaderJar())));
        result.add(Common.build("openEJBJavaagentJar", getSafePath(paths.getOpenEJBJavaagentJar())));
        result.add(Common.build("catalinaHomeDir", getSafePath(paths.getCatalinaHomeDir())));
        result.add(Common.build("catalinaBaseDir", getSafePath(paths.getCatalinaBaseDir())));
        result.add(Common.build("serverXmlFile", getSafePath(paths.getServerXmlFile())));
        return result;
    }
View Full Code Here

            result.add(Common.build(key, message));
        }
    }

    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);
View Full Code Here

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

                }
View Full Code Here

                }
            }
        }

        // from prefix
        final Paths paths = new Paths(new File(System.getProperty("openejb.home"))); // parameter is useless
        for (String prefix : PREFIXES_TO_ADD) {
            final File file = paths.findTomEELibJar(prefix);
            if (file != null) {
                try {
                    urls.add(file.toURI().toURL());
                } catch (MalformedURLException e) {
                    // ignored
View Full Code Here

        // install conf/openejb.xml and conf/logging.properties files
        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();
                }
            }
View Full Code Here

                }
            }
        }

        // from prefix
        final Paths paths = new Paths(new File(System.getProperty("openejb.home"))); // parameter is useless
        for (String prefix : PREFIXES_TO_ADD) {
            final File file = paths.findTomEELibJar(prefix);
            if (file != null) {
                try {
                    urls.add(file.toURI().toURL());
                } catch (MalformedURLException e) {
                    // ignored
View Full Code Here

        // install conf/openejb.xml and conf/logging.properties files
        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();
                }
            }
View Full Code Here

        final String path = Application.getInstance().getRootPath();
        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());
View Full Code Here

        final String path = Application.getInstance().getRootPath();
        File openejbWarDir = null;
        if (path != null) {
            openejbWarDir = new File(path);
        }
        final Paths paths = new Paths(openejbWarDir);

        final Map<String, Object> json = new HashMap<String, Object>();
        json.put("isListenerInstalled", Installer.isListenerInstalled());
        json.put("isAgentInstalled", Installer.isAgentInstalled());


        final Map<String, String> strPaths = new HashMap<String, String>();
        strPaths.put("catalina-conf", getSafePath(paths.getCatalinaConfDir()));
        strPaths.put("catalina-lib", getSafePath(paths.getCatalinaLibDir()));
        strPaths.put("catalina-bin", getSafePath(paths.getCatalinaBinDir()));
        strPaths.put("catalina-catalina-sh", getSafePath(paths.getCatalinaShFile()));
        strPaths.put("catalina-catalina-bat", getSafePath(paths.getCatalinaBatFile()));
        strPaths.put("openEJB-lib", getSafePath(paths.getOpenEJBLibDir()));
        strPaths.put("openEJB-loader-jar", getSafePath(paths.getOpenEJBTomcatLoaderJar()));
        strPaths.put("openEJB-javaagent-jar", getSafePath(paths.getOpenEJBJavaagentJar()));


        final Map<String, String> strMainPaths = new HashMap<String, String>();
        strMainPaths.put("catalina-home", getSafePath(paths.getCatalinaHomeDir()));
        strMainPaths.put("catalina-base", getSafePath(paths.getCatalinaBaseDir()));
        strMainPaths.put("catalina-server-xml", getSafePath(paths.getServerXmlFile()));

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

        final Installer installer = new Installer(paths);
View Full Code Here

TOP

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

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.