src/java.management/share/classes/javax/management/openmbean/OpenMBeanInfo.java
author darcy
Wed, 23 Oct 2019 13:01:40 -0700
changeset 58766 54ffb15c4839
parent 47216 71c04702a3d5
permissions -rw-r--r--
8232442: Suppress warnings on non-serializable non-transient instance fields in java.management.* Reviewed-by: rriggs, mchung
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
24368
2b4801b94265 8038795: Tidy warnings cleanup for javax.management
yan
parents: 5506
diff changeset
     2
 * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
package javax.management.openmbean;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
// java import
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
// jmx import
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.management.MBeanAttributeInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import javax.management.MBeanOperationInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import javax.management.MBeanConstructorInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import javax.management.MBeanNotificationInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * <p>Describes an Open MBean: an Open MBean is recognized as such if
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * its {@link javax.management.DynamicMBean#getMBeanInfo()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * getMBeanInfo()} method returns an instance of a class which
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * implements the {@link OpenMBeanInfo} interface, typically {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * OpenMBeanInfoSupport}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * <p>This interface declares the same methods as the class {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * javax.management.MBeanInfo}.  A class implementing this interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * (typically {@link OpenMBeanInfoSupport}) should extend {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * javax.management.MBeanInfo}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * <p>The {@link #getAttributes()}, {@link #getOperations()} and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * {@link #getConstructors()} methods of the implementing class should
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * return at runtime an array of instances of a subclass of {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * MBeanAttributeInfo}, {@link MBeanOperationInfo} or {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * MBeanConstructorInfo} respectively which implement the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * OpenMBeanAttributeInfo}, {@link OpenMBeanOperationInfo} or {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * OpenMBeanConstructorInfo} interface respectively.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
public interface OpenMBeanInfo {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    // Re-declares the methods that are in class MBeanInfo of JMX 1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    // (methods will be removed when MBeanInfo is made a parent interface of this interface)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * Returns the fully qualified Java class name of the open MBean
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
    73
     * instances this {@code OpenMBeanInfo} describes.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * @return the class name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    public String getClassName() ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * Returns a human readable description of the type of open MBean
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
    81
     * instances this {@code OpenMBeanInfo} describes.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * @return the description.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    public String getDescription() ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    /**
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
    88
     * Returns an array of {@code OpenMBeanAttributeInfo} instances
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * describing each attribute in the open MBean described by this
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
    90
     * {@code OpenMBeanInfo} instance.  Each instance in the returned
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * array should actually be a subclass of
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
    92
     * {@code MBeanAttributeInfo} which implements the
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
    93
     * {@code OpenMBeanAttributeInfo} interface (typically {@link
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * OpenMBeanAttributeInfoSupport}).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * @return the attribute array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    public MBeanAttributeInfo[] getAttributes() ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    /**
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   101
     * Returns an array of {@code OpenMBeanOperationInfo} instances
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * describing each operation in the open MBean described by this
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   103
     * {@code OpenMBeanInfo} instance.  Each instance in the returned
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * array should actually be a subclass of
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   105
     * {@code MBeanOperationInfo} which implements the
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   106
     * {@code OpenMBeanOperationInfo} interface (typically {@link
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * OpenMBeanOperationInfoSupport}).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * @return the operation array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    public MBeanOperationInfo[] getOperations() ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    /**
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   114
     * Returns an array of {@code OpenMBeanConstructorInfo} instances
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * describing each constructor in the open MBean described by this
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   116
     * {@code OpenMBeanInfo} instance.  Each instance in the returned
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * array should actually be a subclass of
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   118
     * {@code MBeanConstructorInfo} which implements the
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   119
     * {@code OpenMBeanConstructorInfo} interface (typically {@link
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * OpenMBeanConstructorInfoSupport}).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * @return the constructor array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    public MBeanConstructorInfo[] getConstructors() ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    /**
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   127
     * Returns an array of {@code MBeanNotificationInfo} instances
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * describing each notification emitted by the open MBean
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   129
     * described by this {@code OpenMBeanInfo} instance.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @return the notification array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    public MBeanNotificationInfo[] getNotifications() ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    // commodity methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    /**
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   140
     * Compares the specified <var>obj</var> parameter with this {@code OpenMBeanInfo} instance for equality.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * <p>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   142
     * Returns {@code true} if and only if all of the following statements are true:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * <li><var>obj</var> is non null,</li>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   145
     * <li><var>obj</var> also implements the {@code OpenMBeanInfo} interface,</li>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * <li>their class names are equal</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * <li>their infos on attributes, constructors, operations and notifications are equal</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * </ul>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   149
     * This ensures that this {@code equals} method works properly for <var>obj</var> parameters which are
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   150
     * different implementations of the {@code OpenMBeanInfo} interface.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     *
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   152
     * @param  obj  the object to be compared for equality with this {@code OpenMBeanInfo} instance;
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   153
     *
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   154
     * @return  {@code true} if the specified object is equal to this {@code OpenMBeanInfo} instance.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    public boolean equals(Object obj);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    /**
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   159
     * Returns the hash code value for this {@code OpenMBeanInfo} instance.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * <p>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   161
     * The hash code of an {@code OpenMBeanInfo} instance is the sum of the hash codes
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   162
     * of all elements of information used in {@code equals} comparisons
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * (ie: its class name, and its infos on attributes, constructors, operations and notifications,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * where the hashCode of each of these arrays is calculated by a call to
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   165
     * {@code new java.util.HashSet(java.util.Arrays.asList(this.getSignature)).hashCode()}).
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * <p>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   167
     * This ensures that {@code t1.equals(t2)} implies that {@code t1.hashCode()==t2.hashCode()}
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   168
     * for any two {@code OpenMBeanInfo} instances {@code t1} and {@code t2},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * as required by the general contract of the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * {@link Object#hashCode() Object.hashCode()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     *
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   172
     * @return  the hash code value for this {@code OpenMBeanInfo} instance
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    public int hashCode();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    /**
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   177
     * Returns a string representation of this {@code OpenMBeanInfo} instance.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * <p>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   179
     * The string representation consists of the name of this class
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   180
     * (ie {@code javax.management.openmbean.OpenMBeanInfo}), the MBean class name,
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   181
     * and the string representation of infos on attributes, constructors,
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   182
     * operations and notifications of the described MBean.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     *
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   184
     * @return  a string representation of this {@code OpenMBeanInfo} instance
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    public String toString();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
}