mioz2077 / pojo-mbean

Automatically exported from code.google.com/p/pojo-mbean
0 stars 0 forks source link

Figure out whether to generate Descriptor in dynamic mbean #4

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Read up on Descriptor 
http://download.oracle.com/javase/6/docs/api/javax/management/Descriptor.html 
and figure out whether it is worth generating by the IntrospectionDynamicMBean

Original issue reported on code.google.com by morten.h...@gmail.com on 8 Jul 2011 at 6:08

GoogleCodeExporter commented 8 years ago
Descriptor adds information about content unit (e.g. seconds, milliseconds, 
dollars etc) as well as bounds (min/max values or permitted enumerations) on 
both operations and attributes.

This could be supported by introducing a new Descriptor annotation type that 
Operation and Property would inherit from, supporting these common attributes.

Quite a bit of work, so unless someone really needs this feature, I doubt it'll 
make it into the code base anytime soon.

Original comment by morten.h...@gmail.com on 9 Jul 2011 at 1:29

GoogleCodeExporter commented 8 years ago

Original comment by morten.h...@gmail.com on 9 Jul 2011 at 5:40

GoogleCodeExporter commented 8 years ago

Original comment by morten.h...@gmail.com on 9 Jul 2011 at 10:49

GoogleCodeExporter commented 8 years ago
It seems a @Descriptor annotation may be of considerable use, mainly to provide 
units of measure for attributes, e.g.
- Seconds, Milliseconds, Date etc.
That alone would save a lot of long attribute names such as "durationSeconds".

Original comment by morten.h...@gmail.com on 9 Jul 2011 at 11:17

GoogleCodeExporter commented 8 years ago

Original comment by morten.h...@gmail.com on 10 Jul 2011 at 1:01

GoogleCodeExporter commented 8 years ago
Created branches/devl-desvriptor to carry out the development of the descriptor 
support.

Original comment by morten.h...@gmail.com on 10 Jul 2011 at 5:36

GoogleCodeExporter commented 8 years ago
Partial implementation committed to devl branch in r90, and

All @ManagedAttribute descriptor fields no modelled, including casting of 
string values (minValue, maxValue, defaultValue, legalValues) to Integer/Long 
for testing, but it seems that the jconsole totally ignores these values when 
assigning values to a writable attribute (try running CountingApplication). It 
shows all the Descriptor fields, but don't use them. Must try a JMX console 
before proceeding to waste more developer time on Descriptors. Sad, really

Original comment by morten.h...@gmail.com on 10 Jul 2011 at 8:42

GoogleCodeExporter commented 8 years ago
I have the gut feeling, that if the Descriptor annotation makes any sense at 
all, we should merge them into the @Description annotation (keeping the default 
"value" being the textual description.

It seems wrong to have both @Description and @Descriptor annotations on the 
same element. The only reason to keep both would be to stay close to the silly 
legacy MBean design.

Probably, I should read up on the JSR 255 spec before making up my mind on this 
one.
Yawn - "Dead Spec Walking" :-D

Original comment by morten.h...@gmail.com on 10 Jul 2011 at 8:47

GoogleCodeExporter commented 8 years ago

Original comment by morten.h...@gmail.com on 13 Jul 2011 at 11:51