Package org.glassfish.api.admin

Examples of org.glassfish.api.admin.AdminCommand


    public ActionReport runCommand(final String command,
            final ParameterMap parameters,
            final ActionReport report,
            final Subject subject) {
        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 AdminCommandContext(ImplUtil.getLogger(), new PlainTextActionReporter());
        final AdminCommand cmd = new RestartDomainCommand(registry);
        cmd.execute(ctx);
    }
View Full Code Here

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

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

                }
            });
            for (ServiceHandle<?> handle : serviceHandles) {
                ActiveDescriptor<?> descriptor = handle.getActiveDescriptor();
                if (descriptor.getName().equals(commandName)) {
                    AdminCommand service = locator.<AdminCommand>getService(descriptor.getImplementationClass());
                    if (service != null) {
                        TargetType targetType = descriptor.getImplementationClass().getAnnotation(TargetType.class);
                        targets = targetType.value();
                        break;
                    }
View Full Code Here

                }
            });
            for (ServiceHandle<?> handle : serviceHandles) {
                ActiveDescriptor<?> descriptor = handle.getActiveDescriptor();
                if (descriptor.getName().equals(commandName)) {
                    AdminCommand service = locator.getService(descriptor.getImplementationClass());
                    if (service != null) {
                        TargetType targetType = descriptor.getImplementationClass().getAnnotation(TargetType.class);
                        targets = targetType.value();
                        break;
                    }
View Full Code Here

                ActiveDescriptor<?> descriptor = handle.getActiveDescriptor();
                if (descriptor.getName().equals(commandName)) {
                    if ( ! descriptor.isReified()) {
                        locator.reifyDescriptor(descriptor);
                    }
                    AdminCommand service = locator.<AdminCommand>getService(descriptor.getImplementationClass());
                    if (service != null) {
                        TargetType targetType = descriptor.getImplementationClass().getAnnotation(TargetType.class);
                        targets = targetType.value();
                        break;
                    }
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

                }
            });
            for (ServiceHandle<?> handle : serviceHandles) {
                ActiveDescriptor<?> descriptor = handle.getActiveDescriptor();
                if (descriptor.getName().equals(commandName)) {
                    AdminCommand service = locator.<AdminCommand>getService(descriptor.getImplementationClass());
                    if (service != null) {
                        TargetType targetType = descriptor.getImplementationClass().getAnnotation(TargetType.class);
                        targets = targetType.value();
                        break;
                    }
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

     * @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.