Package org.jfx4ee.adm4ee.business.server.boundary

Examples of org.jfx4ee.adm4ee.business.server.boundary.Server


            createDomain();
           
        } else if (commandLine.hasOption("start")) {
            Domain domain = getDomain(commandLine.getOptionValue("start"));
            ServerHandler serverHandler = ServerHandler.getInstance(domain);
            Server server = serverHandler.getServer();
            server.initLocalServer();
            CommandResult result = server.startDomain(domain.getDomainName());
            System.exit(result.getExitCode());

        } else if (commandLine.hasOption("stop")) {
            Domain domain = getDomain(commandLine.getOptionValue("stop"));
            ServerHandler serverHandler = ServerHandler.getInstance(domain);
            Server server = serverHandler.getServer();
            server.initLocalServer();
            server.initLocalDomain();
            CommandResult result = server.stopDomain();
            System.exit(result.getExitCode());

        } else if (commandLine.hasOption("watchdog")) {
            watchdog();
View Full Code Here


    }

    protected void ping() {
        Domain domain = getDomain(commandLine.getOptionValue("ping"));
        ServerHandler serverHandler = ServerHandler.getInstance(domain);
        Server server = serverHandler.getServer();
        server.initLocalServer();
        server.initLocalDomain();
        CommandResult result = server.pingManagementResource();
        if (result.isOk()) {
            System.out.println("SUCCESS");
        } else {
            System.out.println("FAILURE");
        }
View Full Code Here

    }

    protected void listApplications() {
        Domain domain = getDomain(commandLine.getOptionValue("applications"));
        ServerHandler serverHandler = ServerHandler.getInstance(domain);
        Server server = serverHandler.getServer();
        server.initLocalServer();
        server.initLocalDomain();
        try {
            Set<String> applications = server.getInstalledApplications();
            System.out.println(applications);
            System.exit(0);
        } catch (Exception ex) {
            System.out.println("ERROR: " + ex);
            System.exit(1);
View Full Code Here

    }

    protected void watchdog() {
        Domain domain = getDomain(commandLine.getOptionValue("watchdog"));
        ServerHandler serverHandler = ServerHandler.getInstance(domain);
        Server server = serverHandler.getServer();
        server.initLocalServer();
        server.initLocalDomain();
        CommandResult result = server.pingManagementResource();
        if (!result.isOk()) {
            System.out.println("Domain is not accessable: " + result.getExitCode() + " " + result.getExitCodeInfo());
            try {
                server.stopDomain();
            } catch (Exception e) {
                // Ignore stop error here
            }
            try {
                // wait some time to be sure it is stopped
                Thread.sleep(5000);
            } catch (InterruptedException ex) {
                logger.log(Level.SEVERE, null, ex);
            }
            result = server.startDomain(domain.getDomainName());
            if (result.isOk()) {
                result = server.pingManagementResource();
            }
        }
        System.exit(result.getExitCode());
    }
View Full Code Here

        domain.setDomainUser(commandLine.getOptionValue("user"));
        domain.setDomainPassword(commandLine.getOptionValue("password"));
       
        // Init the server
        ServerHandler serverHandler = ServerHandler.getInstance(domain);
        Server server = serverHandler.getServer();
        server.initLocalServer();
       
        // Check if there is a template
        File template = null;
        if (commandLine.hasOption("template")) {
            String templateName = commandLine.getOptionValue("template");
            if (templateName != null) {
                template = new File(templateName);
                if (!template.exists()) {
                    System.err.println("Domain template '" + template.getAbsolutePath() + "' does not exist!");
                    System.exit(1);
                }
            }
        }
       
        // Check if there is a port base
        int portBase = -1;
        if (commandLine.hasOption("portbase")) {
            String portbaseStr = commandLine.getOptionValue("portbase");
            if (portbaseStr != null) {
                portBase = Integer.parseInt(portbaseStr);
                if (portBase <= 0) {
                    System.err.println("Invalid portbase '" + portbaseStr + "'!");
                }
            }
        }
       
        boolean checkPorts = true;
        if (commandLine.hasOption("checkports")) {
            String checkPortsStr = commandLine.getOptionValue("checkports");
            if (checkPortsStr != null) {
                checkPorts = Boolean.parseBoolean(checkPortsStr);
            }
        }
       
        // Create the domain
        CommandResult result = server.createDomain(domain.getDomainName(), portBase, template, domain.getDomainUser(), domain.getDomainPassword(), checkPorts);
        if (!result.isOk()) {
            System.err.println(result.getResult());
        }
        System.exit(result.getExitCode());
    }
View Full Code Here

            if (getDomain() != null) {

                // Need a configured domain name here!
                // At least a server type must be set!
                ServerHandler serverHandler = ServerHandler.getInstance(getDomain());
                Server server = serverHandler.getServer();

                //TODO: error message when server null
                setServer(server);

                // For local initialization (includes remote) required values are:
View Full Code Here

TOP

Related Classes of org.jfx4ee.adm4ee.business.server.boundary.Server

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.