Examples of executeAndReturnOutput()


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

     */
    protected void doCommand() throws CommandException {
        // run the remote stop-domain command and throw away the output
        RemoteCLICommand cmd = new RemoteCLICommand(getName(), programOpts, env);
        try {
            cmd.executeAndReturnOutput("stop-domain", "--force", force.toString());
        } catch (Exception e) {
            // The domain server may have died so fast we didn't have time to
            // get the (always successful!!) return data.  This is NOT AN ERROR!
            // see: http://java.net/jira/browse/GLASSFISH-19672
        }
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 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.log(Level.FINER, "{0} is not yet registered to DAS.", instanceName);
            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

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

    private void setRendezvousOccurred(String rendezVal) throws CommandException {
        String dottedName = RENDEZVOUS_DOTTED_NAME + "=" + rendezVal;
        RemoteCLICommand rc = new RemoteCLICommand("set", this.programOpts, this.env);
        logger.log(Level.FINER, "Setting rendezvousOccurred to {0} for instance {1}", new Object[]{rendezVal, instanceName});
        rc.executeAndReturnOutput("set", dottedName);
    }

    /* installdir is product install dir (parent of glassfish install root) */
    private int createNodeImplicit(String name, String installdir, String nodeHost) throws CommandException {
        ArrayList<String> argsList = new ArrayList<String>();
View Full Code Here

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

     */
    private Exception runRemoteStop() {
        // 2 catch blocks just to make things crystal clear.
        try {
            RemoteCLICommand cmd = new RemoteCLICommand("_stop-instance", programOpts, env);
            cmd.executeAndReturnOutput("_stop-instance", "--force", force.toString());
            return null;
        }
        catch (CommandException e) {
            // ReST may have thrown a checked Exception because the server died faster than the
            // server could communicate back!   The ReST client misinterprets it
View Full Code Here

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

    protected String getNodeInstallDir() throws CommandException {
        String installDir = null;
        try {
            RemoteCLICommand rc = new RemoteCLICommand("get", this.programOpts, this.env);
            String s = rc.executeAndReturnOutput("get", "nodes.node." + node + ".install-dir");
            if (s != null) {
                installDir = s.substring(s.indexOf('=') + 1);
            }
        } catch (CommandException ce) {
            // ignore
View Full Code Here

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

    private boolean canSuspend() {

        try {
            RemoteCLICommand cmd = new RemoteCLICommand("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

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

    private boolean isSuspended() {

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

            if (response.indexOf("SUSPENDED=TRUE") >= 0)
                return true;
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.