Please note that this documentation is not final and is subject to change.

Java™ Platform
Standard Ed. 7

DRAFT ea-b76

javax.management
Annotation Type ManagedAttribute


@Retention(value=RUNTIME)
@Target(value=METHOD)
@Documented
public @interface ManagedAttribute

Indicates that a method in an MBean class defines an MBean attribute. This annotation must be applied to a public method of a public class that is itself annotated with an @MBean or @MXBean annotation, or inherits such an annotation from a superclass.

The annotated method must be a getter or setter. In other words, it must look like one of the following...

 T getFoo()
 void setFoo(T param)
 

...where T is any type and Foo is the name of the attribute. For any attribute Foo, if only a getFoo method has a ManagedAttribute annotation, then Foo is a read-only attribute. If only a setFoo method has a ManagedAttribute annotation, then Foo is a write-only attribute. If both getFoo and setFoo methods have the annotation, then Foo is a read-write attribute. In this last case, the type T must be the same in both methods.


Java™ Platform
Standard Ed. 7

DRAFT ea-b76

Submit a bug or feature

Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.