Package org.glassfish.api.admin

Examples of org.glassfish.api.admin.AdminCommand


     * @param paramType expected return type
     *
     * @return parameter value or null in case of any problem.
     */
    public static <T> T getParamValue(AdminCommand command, String name, Class<T> paramType) {
        AdminCommand unwrappedCommand = getUnwrappedCommand(command);
        Class<?> commandClass = unwrappedCommand.getClass();
        for (final Field field : commandClass.getDeclaredFields()) {
            Param param = field.getAnnotation(Param.class);
            if (param != null && name.equals(CommandModel.getParamName(param, field))) {
                if (!paramType.isAssignableFrom(field.getType())) {
                    break; // return null
View Full Code Here


    public ActionReport runCommand(final String command,
            final ParameterMap parameters,
            final ActionReport report) {
        try {
            final AdminCommand adminCommand = commandRunner.getCommand(command, report, logger);
            if (adminCommand==null) {
                // maybe commandRunner already reported the failure?
                if (report.getActionExitCode() == ActionReport.ExitCode.FAILURE)
                    return report;
                String message =
View Full Code Here

    public void restartDomain()
    {
        final ModulesRegistry registry = InjectedValues.getInstance().getModulesRegistry();

        final AdminCommandContext ctx = new AdminCommandContextImpl(ImplUtil.getLogger(), new PlainTextActionReporter());
        final AdminCommand cmd = new RestartDomainCommand(registry);
        cmd.execute(ctx);
    }
View Full Code Here

     * @param paramType expected return type
     *
     * @return parameter value or null in case of any problem.
     */
    public static <T> T getParamValue(AdminCommand command, String name, Class<T> paramType) {
        AdminCommand unwrappedCommand = getUnwrappedCommand(command);
        Class<?> commandClass = unwrappedCommand.getClass();
        for (final Field field : commandClass.getDeclaredFields()) {
            Param param = field.getAnnotation(Param.class);
            if (param != null && name.equals(CommandModel.getParamName(param, field))) {
                if (!paramType.isAssignableFrom(field.getType())) {
                    break; // return null
View Full Code Here

TOP

Related Classes of org.glassfish.api.admin.AdminCommand

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.