Search in sources :

Example 1 with CommandExecution

use of org.glassfish.internal.embedded.admin.CommandExecution in project Payara by payara.

the class EmbeddedAdminCtrImpl method execute.

public CommandExecution execute(String commandName, CommandParameters params) {
    ParameterMap props = params.getOptions();
    if (params.getOperands().size() > 0) {
        for (String op : params.getOperands()) props.add("DEFAULT", op);
    }
    final ActionReport report = new PlainTextActionReporter();
    CommandExecution ce = new CommandExecution() {

        public ActionReport getActionReport() {
            return report;
        }

        public ActionReport.ExitCode getExitCode() {
            return report.getActionExitCode();
        }

        public String getMessage() {
            return report.getMessage();
        }
    };
    runner.getCommandInvocation(commandName, report, kernelIdentity.getSubject()).parameters(props).execute();
    return ce;
}
Also used : CommandExecution(org.glassfish.internal.embedded.admin.CommandExecution) ParameterMap(org.glassfish.api.admin.ParameterMap) ActionReport(org.glassfish.api.ActionReport) PlainTextActionReporter(com.sun.enterprise.v3.common.PlainTextActionReporter)

Aggregations

PlainTextActionReporter (com.sun.enterprise.v3.common.PlainTextActionReporter)1 ActionReport (org.glassfish.api.ActionReport)1 ParameterMap (org.glassfish.api.admin.ParameterMap)1 CommandExecution (org.glassfish.internal.embedded.admin.CommandExecution)1