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

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


        return isRegistered;
    }

    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


        return rendezvousOccurred;
    }

    private void setRendezvousOccurred(String rendezVal) throws CommandException {
        String dottedName = RENDEZVOUS_DOTTED_NAME + "=" + rendezVal;
        RemoteCLICommand rc = new RemoteCLICommand("set", this.programOpts, this.env);
        logger.finer("Setting rendezvousOccurred to " + rendezVal + " for instance " + instanceName);
        rc.executeAndReturnOutput("set", dottedName);
    }
View Full Code Here

        argsList.add(nodeHost);

        String[] argsArray = new String[argsList.size()];
        argsArray = argsList.toArray(argsArray);

        RemoteCLICommand rc = new RemoteCLICommand("_create-node-implicit", this.programOpts, this.env);
        return rc.execute(argsArray);
    }
View Full Code Here

        argsList.add(name);

        String[] argsArray = new String[argsList.size()];
        argsArray = argsList.toArray(argsArray);   

        RemoteCLICommand rc = new RemoteCLICommand("_validate-node", this.programOpts, this.env);
        return rc.execute(argsArray);
    }
View Full Code Here

        }
        return instanceHostName;
    }

    private void setDomainName() throws CommandException {
        RemoteCLICommand rc = new RemoteCLICommand("_get-runtime-info", this.programOpts, this.env);
        ActionReport report = rc.executeAndReturnActionReport("_get-runtime-info", "--target", "server");
        this.domainName = report.findProperty("domain_name");
    }
View Full Code Here

    @Override
    public void postConstruct() {
        super.postConstruct();
        try {
            cmd = new RemoteCLICommand(REMOTE_COMMAND,
                locator.<ProgramOptions>getService(ProgramOptions.class),
                locator.<Environment>getService(Environment.class));
        } catch (CommandException ex) {
            // ignore - will be handled by execute()
        }
View Full Code Here

        // nope, must be a remote command
        logger.finer("Assuming it's a remote command: " + name);
        Environment environment = habitat.getService(Environment.class);
        if (useRest()) {
            return new RemoteCLICommand(name,
                habitat.<ProgramOptions>getService(ProgramOptions.class),
                environment);
        } else {
            return new RemoteCommand(name,
                habitat.<ProgramOptions>getService(ProgramOptions.class),
View Full Code Here

        }

        /*
         * Now get the list of remote commands.
         */
        RemoteCLICommand cmd =
            new RemoteCLICommand("list-commands", po, env);
        ActionReport report = cmd.executeAndReturnActionReport("list-commands");
        List<MessagePart> children = report.getTopMessagePart().getChildren();
        List<String> rcmds = new ArrayList<String>(children.size());
        for (ActionReport.MessagePart msg : children) {
            if (!localnames.contains(msg.getMessage())) {
                rcmds.add(msg.getMessage());
View Full Code Here

        ourDir = getUniquePath(ourDir);
        logger.log(Level.FINER, "Check if server is at location {0}", ourDir);

        try {
            RemoteCLICommand cmd =
                    new RemoteCLICommand("__locations", programOpts, env);
            ActionReport report =
                    cmd.executeAndReturnActionReport(new String[]{"__locations"});
            String theirDirPath = report.findProperty(directoryKey);
            logger.log(Level.FINER, "Remote server has root directory {0}", theirDirPath);

            if (ok(theirDirPath)) {
                File theirDir = getUniquePath(new File(theirDirPath));
View Full Code Here

    }

    protected final int getServerPid() {
        try {
            return Integer.parseInt(
                    new RemoteCLICommand("__locations", programOpts, env)
                    .executeAndReturnActionReport(new String[]{"__locations"})
                    .findProperty("Pid"));
        }
        catch (Exception e) {
            return -1;
View Full Code Here

TOP

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

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.