Package com.sun.enterprise.admin.cli.remote

Examples of com.sun.enterprise.admin.cli.remote.RemoteCommand


        HostAndPort addr = getAdminAddress();
        programOpts.setHostAndPort(addr);
        boolean status = isThisDAS(getDomainRootDir());
        if (status) {
            try {
                RemoteCommand cmd =
                    new RemoteCommand("_get-restart-required",
                                        programOpts, env);
                String restartRequired =
                    cmd.executeAndReturnOutput("_get-restart-required");
                if (Boolean.parseBoolean(restartRequired.trim()))
                    return strings.get("list.domains.StatusRestartRequired");
            } catch (Exception ex) {
            }
            return strings.get("list.domains.StatusRunning");
View Full Code Here


        if (useRest()) {
            return new RemoteCLICommand(name,
                po,
                environment);
        } else {
            return new RemoteCommand(name,
                po,
                environment);
        }
    }
View Full Code Here

        if (useRest()) {
            return new RemoteCLICommand(name,
                habitat.<ProgramOptions>getService(ProgramOptions.class),
                environment);
        } else {
            return new RemoteCommand(name,
                habitat.<ProgramOptions>getService(ProgramOptions.class),
                environment);
        }
    }
View Full Code Here

                    commandOptions,
                    operands
                    );
                Environment env = new Environment();
                ProgramOptions po = prepareRemoteCommandProgramOptions(env);
                RemoteCommand rc =
                    new RemoteCommand(commandName, po, env, "jsr-88/xml", baos);
                rc.executeAndReturnOutput(commandArgs);
                DFDeploymentStatus status = CommandXMLResultParser.parse(new ByteArrayInputStream(baos.toByteArray()));
                return status;
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
View Full Code Here

     * This method determines if the DAS has the ability to suspend itself.
     */
    private boolean canSuspend() {

        try {
            RemoteCommand cmd = new RemoteCommand("list-commands",
                                                  programOpts, env);
            String response = cmd.executeAndReturnOutput("list-commands");

            if (response.indexOf("suspend-domain") >= 0)
                return true;
        } catch (Exception e) {
            logger.info("Exception while probing DAS (list-commands): " +
View Full Code Here

     * This method determines if the DAS is currently suspended.
     */
    private boolean isSuspended() {

        try {
            RemoteCommand cmd = new RemoteCommand("suspend-domain",
                                                  programOpts, env);
            String response = cmd.executeAndReturnOutput("suspend-domain",
                                                         "--_test=true");

            if (response.indexOf("SUSPENDED=TRUE") >= 0)
                return true;

View Full Code Here

        programOpts.setHostAndPort(addr);
        boolean status = isThisDAS(getDomainRootDir());
        String p="domain";
        if (status) {
            try {
                RemoteCommand cmd =
                    new RemoteCommand("_get-restart-required",
                                        programOpts, env);
                String restartRequired =
                    cmd.executeAndReturnOutput("_get-restart-required");
                if (Boolean.parseBoolean(restartRequired.trim()))
                    return strings.get("list.domains.StatusRestartRequired", dn);
            } catch (Exception ex) {
            }
            return strings.get("list.domains.StatusRunning", dn);
View Full Code Here

        if (useRest()) {
            return new RemoteCLICommand(name,
                po,
                environment);
        } else {
            return new RemoteCommand(name,
                po,
                environment);
        }
    }
View Full Code Here

   
    private static CLICommand getRemoteCommand(String name, ProgramOptions po, Environment env) throws CommandException {
        if (useRest()) {
            return new RemoteCLICommand(name, po, env);
        } else {
            return new RemoteCommand(name, po, env);
        }
    }
View Full Code Here

         */
        programOpts.setInteractive(false);

        try {
            // run the remote stop-domain command and throw away the output
            RemoteCommand cmd = new RemoteCommand("_stop-instance", programOpts, env);
            cmd.executeAndReturnOutput("_stop-instance", "--force", force.toString());
            waitForDeath();
        }
        catch (CommandException e) {
            // 1.  We can't access the server at all
            // 2.  We timed-out waiting for it to die
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.cli.remote.RemoteCommand

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.