You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, one and only one of...
- Field
- Getter method
- Setter method
... should be annotated with @ManagedAttribute, and the access level may be
defined using @ManagedAttribute(access=Access.READ_WRITE)
So you could see a setter method annotated with @ManagedAttribute which would
in fact make the related field available for READ only, since Access.READ is
the default access.
A couple of suggestions:
If a method is annotated with @ManagedAttribute, that method is made available
(e.g. if only the setter method has the annotation the attribute would be WRITE
only. This would require default access to be "IMPLIED" or "CONTEXT". And it
would be considered an error, if a @ManagedAttribute annotated method would
have any explicit READ/WRITE/READ_WRITE access. These would be reserved for
@ManagedAttribute anotations on fields.
Having two @ManagedAttribute annotation for a single attribute (getter and
setter method) would cause another problem: Which description to use, if both
annotations define a description attribute.
Possibly, it would be better to remove the description attribute from the
@ManagedAttribute annotation, and move it into a separate @Description
annotation which would also replace the description attribute for
@ManagedOperation and @Parameter. It would be considered an error, if more than
one @Description attribute was added
This last change would also solve the issue of using the "value" annotation
attribute for adding description. This is not ideal, since ...
@ManagedAttribute(value="This is the description", access=Access.READ_WRITE)
... just doesn't seem fluent. I'd rather see ...
@ManagedAttribute(Access.READ_WRITE) @Description("This is the description")
An added bonus is that the above change gets us a little closer to the
(defunct) JMX 2.0/JSR 255 proposal.
Original issue reported on code.google.com by morten.h...@gmail.com on 9 Jul 2011 at 11:37
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
morten.h...@gmail.com
on 9 Jul 2011 at 11:37The text was updated successfully, but these errors were encountered: