FileDocCategorySizeDatePackage
ListResourceAdapterConfigsCommand.javaAPI DocGlassfish v2 API3972Fri May 04 22:25:12 BST 2007com.sun.enterprise.cli.commands

ListResourceAdapterConfigsCommand

public class ListResourceAdapterConfigsCommand extends GenericCommand

Fields Summary
Constructors Summary
Methods Summary
public voidrunCommand()
Execute the command

throws
CommandException

        if (!validateOptions())
            throw new CommandValidationException("Validation failed");
        
		String objectName = getObjectName();
		Object[] params = getParamsInfo();
		String operationName = getOperationName();
		String[] types = getTypesInfo();
			
        MBeanServerConnection mbsc = getMBeanServerConnection(getHost(), getPort(), 
	                                    getUser(), getPassword());
        try 
		{ 
			String rac = (String)mbsc.invoke(new ObjectName(objectName), 
					     		operationName, params, types);
             
			 CLILogger.getInstance().printMessage(rac);
                         CLILogger.getInstance().printDetailMessage(getLocalizedString(
                                                                       "CommandSuccessful",
                                                                       new Object[] {name}));
        }catch(Exception e){ 
			if (e.getLocalizedMessage() != null)
				CLILogger.getInstance().printDetailMessage(e.getLocalizedMessage());
			
			throw new CommandException(getLocalizedString("CommandUnSuccessful",
						     new Object[] {name} ), e);
        }        
    
public booleanvalidateOptions()

        if (getOperands().size() == 1)
        {
            CLILogger.getInstance().printWarning(getLocalizedString("OperandTargetDeprecated"));
        }

        return super.validateOptions();