One of the useful things about descriptors is they can specify default values, min and max value and useful metadata on attributes:
It'd be nice to have an annotation that could represent this next to an attribute. There is an immutable descriptor used for sort, but not the general purpose descriptor values.
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Units {
@DescriptorKey("units")
String value();
}
And JMXWrapper could then pick up the annotation on attribute and add it to the descriptor at runtime.
One of the useful things about descriptors is they can specify default values, min and max value and useful metadata on attributes:
It'd be nice to have an annotation that could represent this next to an attribute. There is an immutable descriptor used for sort, but not the general purpose descriptor values.
https://github.com/uklimaschewski/JMXWrapper/blob/master/src/com/udojava/jmx/wrapper/JMXBeanWrapper.java#L567
For example, using the
DescriptorKeymeta-annotation someone may define a Units("inches") annotationAnd JMXWrapper could then pick up the annotation on attribute and add it to the descriptor at runtime.