Examples of PropsFileActionReporter


Examples of com.sun.enterprise.v3.common.PropsFileActionReporter

        if (params != null)  {
            notifyOption = params.containsKey("notify");
        }
        final CommandRunner.CommandInvocation commandInvocation =
                getCommandRunner().getCommandInvocation(commandName.getScope(),
                commandName.getName(), new PropsFileActionReporter(), getSubject(),notifyOption);
        if (inbound != null) {
            commandInvocation.inbound(inbound);
        }
        commandInvocation
                .outbound(new RestPayloadImpl.Outbound(false))
View Full Code Here

Examples of com.sun.enterprise.v3.common.PropsFileActionReporter

        //Execute it
        boolean notifyOption = false;
        if (params != null)  {
            notifyOption = params.containsKey("notify");
        }
        ActionReporter ar = new PropsFileActionReporter(); //new RestActionReporter(); //Must use PropsFileActionReporter because some commands react diferently on it :-(
        final RestPayloadImpl.Outbound outbound = new RestPayloadImpl.Outbound(false);
        final CommandRunner.CommandInvocation commandInvocation =
                getCommandRunner().getCommandInvocation(commandName.getScope(), commandName.getName(), ar, getSubject(),notifyOption);
        if (inbound != null) {
            commandInvocation.inbound(inbound);
        }
        commandInvocation
                .outbound(outbound)
                .parameters(params)
                .execute();
        ar = (ActionReporter) commandInvocation.report();
        fixActionReporterSpecialCases(ar);
        ActionReport.ExitCode exitCode = ar.getActionExitCode();
        int status = HttpURLConnection.HTTP_OK; /*200 - ok*/
        if (exitCode == ActionReport.ExitCode.FAILURE) {
            status = HttpURLConnection.HTTP_INTERNAL_ERROR;
        }
        ResponseBuilder rb = Response.status(status);
View Full Code Here

Examples of com.sun.enterprise.v3.common.PropsFileActionReporter

        try {
            commandInvocation.execute();
        } catch (Throwable thr) {
            RestLogging.restLogger.log(Level.WARNING, RestLogging.UNEXPECTED_EXCEPTION,
                    thr.toString());
            ActionReport actionReport = new PropsFileActionReporter(); //new RestActionReporter();
            actionReport.setFailureCause(thr);
            actionReport.setActionExitCode(ActionReport.ExitCode.FAILURE);
            AdminCommandState acs = new AdminCommandStateImpl(AdminCommandState.State.COMPLETED, actionReport, true, "unknown");
            onAdminCommandEvent(AdminCommandStateImpl.EVENT_STATE_CHANGED, acs);
        } finally {
            try {
                eventOuptut.close();
View Full Code Here

Examples of com.sun.enterprise.v3.common.PropsFileActionReporter

        CommandModel model = getCommandModel(commandName);
        checkCommandModelETag(model, modelETag);
        //Execute it
        final CommandRunner.CommandInvocation commandInvocation =
                getCommandRunner().getCommandInvocation(commandName.getScope(),
                commandName.getName(), new PropsFileActionReporter(), getSubject());
        if (inbound != null) {
            commandInvocation.inbound(inbound);
        }
        commandInvocation
                .outbound(new RestPayloadImpl.Outbound(false))
View Full Code Here

Examples of com.sun.enterprise.v3.common.PropsFileActionReporter

        }
        //Check command model
        CommandModel model = getCommandModel(commandName);
        checkCommandModelETag(model, modelETag);
        //Execute it
        ActionReporter ar = new PropsFileActionReporter(); //new RestActionReporter(); //Must use PropsFileActionReporter because some commands react diferently on it :-(
        final RestPayloadImpl.Outbound outbound = new RestPayloadImpl.Outbound(false);
        final CommandRunner.CommandInvocation commandInvocation =
                getCommandRunner().getCommandInvocation(commandName.getScope(), commandName.getName(), ar, getSubject());
        if (inbound != null) {
            commandInvocation.inbound(inbound);
        }
        commandInvocation
                .outbound(outbound)
                .parameters(params)
                .execute();
        ar = (ActionReporter) commandInvocation.report();
        fixActionReporterSpecialCases(ar);
        ActionReport.ExitCode exitCode = ar.getActionExitCode();
        int status = HttpURLConnection.HTTP_OK; /*200 - ok*/
        if (exitCode == ActionReport.ExitCode.FAILURE) {
            status = HttpURLConnection.HTTP_INTERNAL_ERROR;
        }
        ResponseBuilder rb = Response.status(status);
View Full Code Here

Examples of com.sun.enterprise.v3.common.PropsFileActionReporter

            commandInvocation.execute();
        } catch (Throwable thr) {
            logger.log(Level.WARNING, strings.getLocalString("sse.commandexecution.unexpectedexception",
                    "Unexpected exception during command execution. {0}",
                    thr.toString()));
            ActionReport actionReport = new PropsFileActionReporter(); //new RestActionReporter();
            actionReport.setFailureCause(thr);
            actionReport.setActionExitCode(ActionReport.ExitCode.FAILURE);
            AdminCommandState acs = new AdminCommandStateImpl(AdminCommandState.State.COMPLETED, actionReport, true, "unknown");
            onAdminCommandEvent(AdminCommandStateImpl.EVENT_STATE_CHANGED, acs);
        } finally {
            try {
                eventChannel.close();
View Full Code Here

Examples of com.sun.enterprise.v3.common.PropsFileActionReporter

        CommandModel model = getCommandModel(commandName);
        checkCommandModelETag(model, modelETag);
        //Execute it
        final CommandRunner.CommandInvocation commandInvocation =
                getCommandRunner().getCommandInvocation(commandName.getScope(),
                commandName.getName(), new PropsFileActionReporter());
        if (inbound != null) {
            commandInvocation.inbound(inbound);
        }
        commandInvocation
                .outbound(new RestPayloadImpl.Outbound(false))
View Full Code Here

Examples of com.sun.enterprise.v3.common.PropsFileActionReporter

        }
        //Check command model
        CommandModel model = getCommandModel(commandName);
        checkCommandModelETag(model, modelETag);
        //Execute it
        ActionReporter ar = new PropsFileActionReporter(); //new RestActionReporter(); //Must use PropsFileActionReporter because some commands react diferently on it :-(
        final RestPayloadImpl.Outbound outbound = new RestPayloadImpl.Outbound(false);
        final CommandRunner.CommandInvocation commandInvocation =
                getCommandRunner().getCommandInvocation(commandName.getScope(), commandName.getName(), ar);
        if (inbound != null) {
            commandInvocation.inbound(inbound);
        }
        commandInvocation
                .outbound(outbound)
                .parameters(params)
                .subject(getSubject())
                .execute();
        ar = (ActionReporter) commandInvocation.report();
        fixActionReporterSpecialCases(ar);
        ActionReport.ExitCode exitCode = ar.getActionExitCode();
        int status = HttpURLConnection.HTTP_OK; /*200 - ok*/
        if (exitCode == ActionReport.ExitCode.FAILURE) {
            status = HttpURLConnection.HTTP_INTERNAL_ERROR;
        }
        ResponseBuilder rb = Response.status(status);
View Full Code Here

Examples of com.sun.enterprise.v3.common.PropsFileActionReporter

        executor.submit(new Runnable() {
                                @Override
                                public void run() {
                                    CommandRunner cr = habitat.getService(CommandRunner.class);
                                    final CommandRunner.CommandInvocation invocation =
                                                    cr.getCommandInvocation("uptime", new PropsFileActionReporter(), kernelIdentity.getSubject());
                                    invocation.parameters(new ParameterMap());
                                    invocation.execute();
                                }
                            });
        executor.shutdown();
View Full Code Here

Examples of com.sun.enterprise.v3.common.PropsFileActionReporter

        CommandModel model = getCommandModel(commandName);
        checkCommandModelETag(model, modelETag);
        //Execute it
        final CommandRunner.CommandInvocation commandInvocation =
                getCommandRunner().getCommandInvocation(commandName.getScope(),
                commandName.getName(), new PropsFileActionReporter(), getSubject());
        if (inbound != null) {
            commandInvocation.inbound(inbound);
        }
        commandInvocation
                .outbound(new RestPayloadImpl.Outbound(false))
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.