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 MBean


@Retention(value=RUNTIME)
@Target(value=TYPE)
@Inherited
public @interface MBean

Indicates that the annotated class is a Standard MBean. A Standard MBean class can be defined as in this example:

 @MBean
 public class Configuration {
     @ManagedAttribute
     public int getCacheSize() {...}
     @ManagedAttribute
     public void setCacheSize(int size);

     @ManagedAttribute
     public long getLastChangedTime();

     @ManagedOperation
     public void save();
 }
 

The class must be public. Public methods within the class can be annotated with @ManagedOperation to indicate that they are MBean operations. Public getter and setter methods within the class can be annotated with @ManagedAttribute to indicate that they define MBean attributes.

If the MBean is to be an MXBean rather than a Standard MBean, then the @MXBean annotation must be used instead of @MBean.


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.