info= new MBeanAttributeInfo(name,OBJECT_NAME_ARRAY,description,getter!=null,setter!=null,getter!=null&&getter.getName().startsWith("is"));
info= new MBeanAttributeInfo(name,OBJECT_NAME_ARRAY_CLASS,description,getter!=null,setter!=null,getter!=null&&getter.getName().startsWith("is"));
    public MBeanAttributeInfo defineAttribute(String name, String metaData)    {        String[] tokens=metaData.split(":",3);        int i=tokens.length-1;        String description=tokens[i--];        boolean writable= i<0 || "RW".equalsIgnoreCase(tokens[i--]);        boolean onMBean= i==0 && "MBean".equalsIgnoreCase(tokens[0]);        boolean convert= i==0 && "MObject".equalsIgnoreCase(tokens[0]);                if (Log.isDebugEnabled())            Log.debug("defineAttribute "+name+" "+onMBean+":"+writable+":"+description);                String uName = name.substring(0, 1).toUpperCase() + name.substring(1);        Class oClass = onMBean ? this.getClass() : _managed.getClass();                Class type = null;        Method getter = null;        Method setter = null;        Method[] methods = oClass.getMethods();        for (int m = 0; m < methods.length; m++)        {            if ((methods[m].getModifiers() & Modifier.PUBLIC) == 0)                continue;            // Look for a getter            if (methods[m].getName().equals("get" + uName) && methods[m].getParameterTypes().length == 0)            {                if (getter != null)                    throw new IllegalArgumentException("Multiple getters for attr " + name);                getter = methods[m];                if (type != null && !type.equals(methods[m].getReturnType()))                    throw new IllegalArgumentException("Type conflict for attr " + name);                type = methods[m].getReturnType();            }            // Look for an is getter            if (methods[m].getName().equals("is" + uName) && methods[m].getParameterTypes().length == 0)            {                if (getter != null)                    throw new IllegalArgumentException("Multiple getters for attr " + name);                getter = methods[m];                if (type != null && !type.equals(methods[m].getReturnType()))                    throw new IllegalArgumentException("Type conflict for attr " + name);                type = methods[m].getReturnType();            }                        // look for a setter            if (writable && methods[m].getName().equals("set" + uName) && methods[m].getParameterTypes().length == 1)            {                if (setter != null)                    throw new IllegalArgumentException("Multiple setters for attr " + name);                setter = methods[m];                if (type != null && !type.equals(methods[m].getParameterTypes()[0]))                    throw new IllegalArgumentException("Type conflict for attr " + name);                type = methods[m].getParameterTypes()[0];            }        }                if (convert && type.isPrimitive() && !type.isArray())            throw new IllegalArgumentException("Cannot convert primative " + name);                if (getter == null && setter == null)            throw new IllegalArgumentException("No getter or setters found for " + name);        try        {            // Remember the methods            _getters.put(name, getter);            _setters.put(name, setter);            MBeanAttributeInfo info=null;            if (convert)            {                _convert.add(name);                if (type.isArray())                    info= new MBeanAttributeInfo(name,OBJECT_NAME_ARRAY,description,getter!=null,setter!=null,getter!=null&&getter.getName().startsWith("is"));                                else                    info= new MBeanAttributeInfo(name,OBJECT_NAME_CLASS,description,getter!=null,setter!=null,getter!=null&&getter.getName().startsWith("is"));            }            else                info= new MBeanAttributeInfo(name,description,getter,setter);                        return info;        }        catch (Exception e)        {            Log.warn(Log.EXCEPTION, e);            throw new IllegalArgumentException(e.toString());        }    }