Closed TuomasKiviaho closed 10 years ago
I'll have a look, looks quite easy.
I have added support to specify the order of attributes and operations.
Only complex task was to push the changes to the repository - I pushed the wrong repository to this repository and had to push the complete project again. So do not wonder about the strange file histories now.
I Hope you find it useful, I think I found a more elegant way of specifying the sort order instead of specifying arrays:
To sort attributes and operations in a certain way, you have to mark the bean as sorted.
By default, attributes and operations will be sorted by their name. You can specify a
sortValue
for the operations and attributes to override the default value.
@JMXBean(sorted=true)
public class MyBean {
int level = 0;
@JMXBeanAttribute(nameKey="level", descriptionKey="levelDescription", sortKey="1")
public int getLevel() {
return level;
}
@JMXBeanOperation(sortValue="2")
public String methodX(String p1) {
return p1;
}
}
Would it be possible to re-order attributes and operation alphabetically. Furthermore @JMXBean could have "attributes" and "operations" arrays where one could define a more specific order by listing each annotated method/property name.