833
|
1 |
/*
|
|
2 |
* Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
|
7 |
* published by the Free Software Foundation. Sun designates this
|
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
|
9 |
* by Sun in the LICENSE file that accompanied this code.
|
|
10 |
*
|
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
* accompanied this code).
|
|
16 |
*
|
|
17 |
* You should have received a copy of the GNU General Public License version
|
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
*
|
|
21 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
22 |
* CA 95054 USA or visit www.sun.com if you need additional information or
|
|
23 |
* have any questions.
|
|
24 |
*/
|
|
25 |
|
|
26 |
package javax.management;
|
|
27 |
|
|
28 |
import java.lang.annotation.Documented;
|
|
29 |
import java.lang.annotation.ElementType;
|
|
30 |
import java.lang.annotation.Retention;
|
|
31 |
import java.lang.annotation.RetentionPolicy;
|
|
32 |
import java.lang.annotation.Target;
|
|
33 |
|
|
34 |
/**
|
|
35 |
* <p>Indicates that a method in an MBean class defines an MBean attribute.
|
|
36 |
* This annotation must be applied to a public method of a public class
|
|
37 |
* that is itself annotated with an {@link MBean @MBean} or
|
|
38 |
* {@link MXBean @MXBean} annotation, or inherits such an annotation from
|
|
39 |
* a superclass.</p>
|
|
40 |
*
|
|
41 |
* <p>The annotated method must be a getter or setter. In other words,
|
|
42 |
* it must look like one of the following...</p>
|
|
43 |
*
|
|
44 |
* <pre>
|
|
45 |
* <i>T</i> get<i>Foo</i>()
|
|
46 |
* void set<i>Foo</i>(<i>T</i> param)
|
|
47 |
* </pre>
|
|
48 |
*
|
|
49 |
* <p>...where <i>{@code T}</i> is any type and <i>{@code Foo}</i> is the
|
|
50 |
* name of the attribute. For any attribute <i>{@code Foo}</i>, if only
|
|
51 |
* a {@code get}<i>{@code Foo}</i> method has a {@code ManagedAttribute}
|
|
52 |
* annotation, then <i>{@code Foo}</i> is a read-only attribute. If only
|
|
53 |
* a {@code set}<i>{@code Foo}</i> method has a {@code ManagedAttribute}
|
|
54 |
* annotation, then <i>{@code Foo}</i> is a write-only attribute. If
|
|
55 |
* both {@code get}<i>{@code Foo}</i> and {@code set}<i>{@code Foo}</i>
|
|
56 |
* methods have the annotation, then <i>{@code Foo}</i> is a read-write
|
|
57 |
* attribute. In this last case, the type <i>{@code T}</i> must be the
|
|
58 |
* same in both methods.</p>
|
|
59 |
*/
|
|
60 |
@Retention(RetentionPolicy.RUNTIME)
|
|
61 |
@Target(ElementType.METHOD)
|
|
62 |
@Documented
|
|
63 |
public @interface ManagedAttribute {
|
|
64 |
}
|