Examples of executeAndReturnOutput()


Examples of com.sun.enterprise.admin.cli.remote.RemoteCLICommand.executeAndReturnOutput()

            try {
                RemoteCLICommand cmd =
                        new RemoteCLICommand("_get-restart-required",
                        programOpts, env);
                String restartRequired =
                        cmd.executeAndReturnOutput("_get-restart-required");
                di.restartRequired = Boolean.parseBoolean(restartRequired.trim());
                if (di.restartRequired) {
                    di.statusMsg = strings.get("list.domains.StatusRestartRequired", dn);
                }
            }
View Full Code Here

Examples of com.sun.enterprise.admin.cli.remote.RemoteCLICommand.executeAndReturnOutput()

     * Execute the actual stop-domain command.
     */
    protected void doCommand() throws CommandException {
        // run the remote stop-domain command and throw away the output
        RemoteCLICommand cmd = new RemoteCLICommand(getName(), programOpts, env);
        cmd.executeAndReturnOutput("stop-domain", "--force", force.toString());
        try {
            waitForDeath();
        } catch (CommandException ex) {
            if (kill && local) {
                kill();
View Full Code Here

Examples of com.sun.enterprise.admin.cli.remote.RemoteCLICommand.executeAndReturnOutput()

            try {
                RemoteCLICommand cmd =
                        new RemoteCLICommand("_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) {
            }
View Full Code Here

Examples of com.sun.enterprise.admin.cli.remote.RemoteCLICommand.executeAndReturnOutput()

    /**
     * Get uptime from the server.
     */
    protected final long getUptime() throws CommandException {
        RemoteCLICommand cmd = new RemoteCLICommand("uptime", programOpts, env);
        String up = cmd.executeAndReturnOutput("uptime", "--milliseconds").trim();
        long up_ms = parseUptime(up);

        if (up_ms <= 0) {
            throw new CommandException(strings.get("restart.dasNotRunning"));
        }
View Full Code Here

Examples of com.sun.enterprise.admin.cli.remote.RemoteCLICommand.executeAndReturnOutput()

        try {
            // run the remote stop-domain command and throw away the output
            // the calling code has already verified the server is running.
            // CAREFUL -- intricate code!
            RemoteCLICommand cmd = new RemoteCLICommand("_stop-instance", programOpts, env);
            cmd.executeAndReturnOutput("_stop-instance", "--force", force.toString());
        }
        catch (CommandException e) {
            // ReST may have thrown an Exception because the server died faster than the
            // server could communicate back!   The ReST client misinterprets it
            // to mean the server is not reachable.  This is a special case.  And it
View Full Code Here

Examples of com.sun.enterprise.admin.cli.remote.RemoteCLICommand.executeAndReturnOutput()

    /**
     * Get uptime from the server.
     */
    protected final long getUptime() throws CommandException {
        RemoteCLICommand cmd = new RemoteCLICommand("uptime", programOpts, env);
        String up = cmd.executeAndReturnOutput("uptime", "--milliseconds").trim();
        long up_ms = parseUptime(up);

        if (up_ms <= 0) {
            throw new CommandException(strings.get("restart.dasNotRunning"));
        }
View Full Code Here

Examples of com.sun.enterprise.admin.cli.remote.RemoteCLICommand.executeAndReturnOutput()

    private void setRendezvousOccurred(String rendezVal) {
        String dottedName = RENDEZVOUS_DOTTED_NAME + "=" + rendezVal;
        try {
            RemoteCLICommand rc = new RemoteCLICommand("set", this.programOpts, this.env);
            rc.executeAndReturnOutput("set", dottedName);
        } catch (CommandException ex) {
            logger.warning(Strings.get("import.sync.bundle.completeRegistrationFailed", dottedName));
        }
    }
View Full Code Here

Examples of com.sun.enterprise.admin.cli.remote.RemoteCLICommand.executeAndReturnOutput()

    private void setRendezvousOccurred(String rendezVal) {
        String dottedName = RENDEZVOUS_DOTTED_NAME + "=" + rendezVal;
        try {
            RemoteCLICommand rc = new RemoteCLICommand("set", this.programOpts, this.env);
            rc.executeAndReturnOutput("set", dottedName);
        } catch (CommandException ex) {
            logger.warning(Strings.get("import.sync.bundle.completeRegistrationFailed", dottedName));
        }
    }
View Full Code Here

Examples of com.sun.enterprise.admin.cli.remote.RemoteCLICommand.executeAndReturnOutput()

    private boolean isRegisteredToDAS() {
        boolean isRegistered = false;
        try {
            RemoteCLICommand rc = new RemoteCLICommand("get", this.programOpts, this.env);
            rc.executeAndReturnOutput("get", INSTANCE_DOTTED_NAME);
            isRegistered = true;
        } catch (CommandException ex) {
            logger.finer(instanceName +" is not yet registered to DAS.");
            isRegistered=false;
        }
View Full Code Here

Examples of com.sun.enterprise.admin.cli.remote.RemoteCLICommand.executeAndReturnOutput()

    private boolean rendezvousOccurred() {
        boolean rendezvousOccurred = false;
        RemoteCLICommand rc = null;
        try {
            rc = new RemoteCLICommand("get", this.programOpts, this.env);
            String s = rc.executeAndReturnOutput("get", RENDEZVOUS_DOTTED_NAME);
            String val = s.substring(s.indexOf("=") + 1);
            rendezvousOccurred = Boolean.parseBoolean(val);
            logger.log(Level.FINER, "rendezvousOccurred = {0} for instance {1}", new Object[]{val, instanceName});
        } catch (CommandException ce) {
            logger.log(Level.FINER,RENDEZVOUS_PROPERTY_NAME + " property may not be set yet on {0}", instanceName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.