use of javax.management.modelmbean.ModelMBeanAttributeInfo in project orientdb by orientechnologies.
the class OPerformanceStatisticManagerMBean method populateWriteCacheOverflowCount.
private void populateWriteCacheOverflowCount(List<MBeanAttributeInfo> performanceAttributes) {
final MBeanAttributeInfo writeCacheOverflowCount = new ModelMBeanAttributeInfo(WRITE_CACHE_OVERFLOW_COUNT, long.class.getName(), "Count of times when there was not enough space in write cache to keep already written data", true, false, false);
performanceAttributes.add(writeCacheOverflowCount);
}
use of javax.management.modelmbean.ModelMBeanAttributeInfo in project orientdb by orientechnologies.
the class OPerformanceStatisticManagerMBean method populateReadSpeedFromCache.
private void populateReadSpeedFromCache(List<MBeanAttributeInfo> performanceAttributes, Collection<String> components) {
final MBeanAttributeInfo readSpeedFromCache = new ModelMBeanAttributeInfo(READ_SPEED_FROM_CACHE, long.class.getName(), "Read speed from disk cache in pages per second", true, false, false);
performanceAttributes.add(readSpeedFromCache);
for (String component : components) {
final MBeanAttributeInfo componentReadSpeedFromCache = new ModelMBeanAttributeInfo(READ_SPEED_FROM_CACHE + COMPONENT_SEPARATOR + component, long.class.getName(), "Read speed from disk cache in pages per second for component " + component, true, false, false);
performanceAttributes.add(componentReadSpeedFromCache);
}
}
use of javax.management.modelmbean.ModelMBeanAttributeInfo in project orientdb by orientechnologies.
the class OPerformanceStatisticManagerMBean method populateWriteCacheFlushOperationsTime.
private void populateWriteCacheFlushOperationsTime(List<MBeanAttributeInfo> performanceAttributes) {
final MBeanAttributeInfo flushOperationsTime = new ModelMBeanAttributeInfo(WRITE_CACHE_FLUSH_OPERATION_TIME, long.class.getName(), "Time which is spent on each flush operation", true, false, false);
performanceAttributes.add(flushOperationsTime);
}
use of javax.management.modelmbean.ModelMBeanAttributeInfo in project orientdb by orientechnologies.
the class OPerformanceStatisticManagerMBean method populateFullCheckpointCount.
private void populateFullCheckpointCount(List<MBeanAttributeInfo> performanceAttributes) {
final MBeanAttributeInfo fullCheckpointCount = new ModelMBeanAttributeInfo(FULL_CHECKPOINT_COUNT, long.class.getName(), "Amount of times full checkpoints were executed by storage", true, false, false);
performanceAttributes.add(fullCheckpointCount);
}
use of javax.management.modelmbean.ModelMBeanAttributeInfo in project spring-framework by spring-projects.
the class AbstractReflectiveMBeanInfoAssembler method getAttributeInfo.
/**
* Iterate through all properties on the MBean class and gives subclasses
* the chance to vote on the inclusion of both the accessor and mutator.
* If a particular accessor or mutator is voted for inclusion, the appropriate
* metadata is assembled and passed to the subclass for descriptor population.
* @param managedBean the bean instance (might be an AOP proxy)
* @param beanKey the key associated with the MBean in the beans map
* of the {@code MBeanExporter}
* @return the attribute metadata
* @throws JMException in case of errors
* @see #populateAttributeDescriptor
*/
@Override
protected ModelMBeanAttributeInfo[] getAttributeInfo(Object managedBean, String beanKey) throws JMException {
PropertyDescriptor[] props = BeanUtils.getPropertyDescriptors(getClassToExpose(managedBean));
List<ModelMBeanAttributeInfo> infos = new ArrayList<>();
for (PropertyDescriptor prop : props) {
Method getter = prop.getReadMethod();
if (getter != null && getter.getDeclaringClass() == Object.class) {
continue;
}
if (getter != null && !includeReadAttribute(getter, beanKey)) {
getter = null;
}
Method setter = prop.getWriteMethod();
if (setter != null && !includeWriteAttribute(setter, beanKey)) {
setter = null;
}
if (getter != null || setter != null) {
// If both getter and setter are null, then this does not need exposing.
String attrName = JmxUtils.getAttributeName(prop, isUseStrictCasing());
String description = getAttributeDescription(prop, beanKey);
ModelMBeanAttributeInfo info = new ModelMBeanAttributeInfo(attrName, description, getter, setter);
Descriptor desc = info.getDescriptor();
if (getter != null) {
desc.setField(FIELD_GET_METHOD, getter.getName());
}
if (setter != null) {
desc.setField(FIELD_SET_METHOD, setter.getName());
}
populateAttributeDescriptor(desc, getter, setter, beanKey);
info.setDescriptor(desc);
infos.add(info);
}
}
return infos.toArray(new ModelMBeanAttributeInfo[infos.size()]);
}
Aggregations