FileDocCategorySizeDatePackage
CreateMBeanCommand.javaAPI DocGlassfish v2 API4502Fri May 04 22:25:08 BST 2007com.sun.enterprise.cli.commands

CreateMBeanCommand

public class CreateMBeanCommand extends GenericCommand

Fields Summary
public static final String
TARGET_OPTION
public static final String
NAME_OPTION
public static final String
OBJECT_NAME_OPTION
public static final String
ATTRIBUTES_OPTION
public static final String
ATTRIBUTE_DELIMITER
public static final String
ATTRIBUTE_VALUE_DELIMITER
Constructors Summary
Methods Summary
private java.util.MapgetAttributesList(java.lang.String attributesStr)
Formulate and Returns Properties from the given string

return
Properties

        Map attributes = new HashMap();
        if (attributesStr == null) return attributes;
        final CLITokenizer attrTok = new CLITokenizer(attributesStr, ATTRIBUTE_DELIMITER);
        while (attrTok.hasMoreTokens()) {
            final String nameAndvalue = attrTok.nextToken();
            final CLITokenizer nameTok = new CLITokenizer(nameAndvalue, ATTRIBUTE_VALUE_DELIMITER);
            if (nameTok.countTokens() == 2)
            {
                attributes.put(nameTok.nextTokenWithoutEscapeAndQuoteChars(),
                               nameTok.nextTokenWithoutEscapeAndQuoteChars());
            }
            else
            {
                throw new CommandValidationException(getLocalizedString("InvalidAttributeSyntax"));
            }
        }
        CLILogger.getInstance().printDebugMessage("Got the Attributes List : " + attributes.toString());
        return attributes;
    
protected java.lang.Object[]getParamsInfo()


    /*
     * Returns the Params from the properties
     * @return params returns params
     */
        
    
        Object[] paramsInfo = new Object[3];
        paramsInfo[0] = getOption(TARGET_OPTION);
        Map mbeanParams = new HashMap();
        if (getOption(NAME_OPTION) != null)
            mbeanParams.put(ServerTags.NAME, getOption(NAME_OPTION));
        if (getOption(OBJECT_NAME_OPTION) != null)
            mbeanParams.put(ServerTags.OBJECT_NAME, getOption(OBJECT_NAME_OPTION));
        mbeanParams.put(ServerTags.IMPL_CLASS_NAME, getOperands().get(0));
        paramsInfo[1] = mbeanParams;
        paramsInfo[2] = getAttributesList(getOption(ATTRIBUTES_OPTION));
        return paramsInfo;