public ModelMBeanAttributeInfo getAttribute(String name) { for (ModelMBeanAttributeInfo attribute : attributes) { if (attribute.getName().equals(name)) return attribute; } return null; }
public ModelMBeanAttributeInfo getAttribute(String name) { for (ModelMBeanAttributeInfo attribute : attributes) { if (attribute.getName().equals(name)) return attribute; } return null; }
@Override public String getName() { return getMetadata().getName(); }
@Override public String getName() { return getMetadata().getName(); }
protected void doCollectAttributes(Class<?> clazz, BeanInfo beanInfo) { for (PropertyDescriptor propertyInfo : beanInfo.getPropertyDescriptors()) { if (propertyInfo.isHidden()) { continue; } ModelMBeanAttributeInfo attributeInfo = null; try { Descriptor descriptor = doGetDescriptor(propertyInfo, "attribute"); Method readMethod = propertyInfo.getReadMethod(); Method writeMethod = propertyInfo.getWriteMethod(); if (readMethod != null) { descriptor.setField("getMethod", readMethod.getName()); } if (writeMethod != null) { descriptor.setField("setMethod", writeMethod.getName()); } attributeInfo = new ModelMBeanAttributeInfo(propertyInfo.getName(), propertyInfo.getShortDescription(), propertyInfo.getReadMethod(), propertyInfo.getWriteMethod(), descriptor); } catch (IntrospectionException e) { continue; } attributesInfo.put(attributeInfo.getName(), attributeInfo); } }
String name=attrInfo.getName(); String uName=name.substring(0,1).toUpperCase()+name.substring(1); Class oClass=_object.getClass();
String name=attrInfo.getName(); String uName=name.substring(0,1).toUpperCase()+name.substring(1); Class oClass=_object.getClass();
descrMap.put(modelAttrInfo.getName(), modelAttrInfo.getDescriptor());
descrMap.put(modelAttrInfo.getName(), modelAttrInfo.getDescriptor());
protected void initAttributeContexts(MBeanAttributeInfo[] attributes) { super.initAttributeContexts(attributes); for (int i = 0; i < attributes.length; ++i) { ModelMBeanAttributeInfo info = (ModelMBeanAttributeInfo) attributes[i]; String name = info.getName(); InvocationContext ctx = (InvocationContext) attributeContextMap.get(name); ctx.setDescriptor(info.getDescriptor()); ctx.setReadable(info.isReadable()); ctx.setWritable(info.isWritable()); } }
protected void initAttributeContexts(MBeanAttributeInfo[] attributes) { super.initAttributeContexts(attributes); for (int i = 0; i < attributes.length; ++i) { ModelMBeanAttributeInfo info = (ModelMBeanAttributeInfo) attributes[i]; String name = info.getName(); InvocationContext ctx = (InvocationContext) attributeContextMap.get(name); ctx.setDescriptor(info.getDescriptor()); ctx.setReadable(info.isReadable()); ctx.setWritable(info.isWritable()); } }