Frames | No Frames |
1: /* OpenMBeanInfo.java -- Open typed info about a management bean. 2: Copyright (C) 2006 Free Software Foundation, Inc. 3: 4: This file is part of GNU Classpath. 5: 6: GNU Classpath is free software; you can redistribute it and/or modify 7: it under the terms of the GNU General Public License as published by 8: the Free Software Foundation; either version 2, or (at your option) 9: any later version. 10: 11: GNU Classpath is distributed in the hope that it will be useful, but 12: WITHOUT ANY WARRANTY; without even the implied warranty of 13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14: General Public License for more details. 15: 16: You should have received a copy of the GNU General Public License 17: along with GNU Classpath; see the file COPYING. If not, write to the 18: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19: 02110-1301 USA. 20: 21: Linking this library statically or dynamically with other modules is 22: making a combined work based on this library. Thus, the terms and 23: conditions of the GNU General Public License cover the whole 24: combination. 25: 26: As a special exception, the copyright holders of this library give you 27: permission to link this library with independent modules to produce an 28: executable, regardless of the license terms of these independent 29: modules, and to copy and distribute the resulting executable under 30: terms of your choice, provided that you also meet, for each linked 31: independent module, the terms and conditions of the license of that 32: module. An independent module is a module which is not derived from 33: or based on this library. If you modify this library, you may extend 34: this exception to your version of the library, but you are not 35: obligated to do so. If you do not wish to do so, delete this 36: exception statement from your version. */ 37: 38: package javax.management.openmbean; 39: 40: import javax.management.MBeanAttributeInfo; 41: import javax.management.MBeanConstructorInfo; 42: import javax.management.MBeanNotificationInfo; 43: import javax.management.MBeanOperationInfo; 44: 45: /** 46: * Describes an open management bean. Open management beans are 47: * management beans where {@link 48: * javax.management.DynamicMBean#getMBeanInfo()} returns an 49: * implementation of this interface. This interface includes those 50: * methods specified by {@link javax.management.MBeanInfo}, 51: * so implementations should extend this class. Each method 52: * which returns an array of one of the <code>MBeanXXXInfo</code> 53: * classes should return an array containing instances 54: * of the equivalent open version (<code>OpenMBeanXXXInfo</code>). 55: * 56: * @author Andrew John Hughes (gnu_andrew@member.fsf.org) 57: * @since 1.5 58: */ 59: public interface OpenMBeanInfo 60: { 61: 62: /** 63: * Compares this attribute with the supplied object. This returns 64: * true iff the object is an instance of {@link OpenMBeanInfo} 65: * with the same class name and equal instances of the info classes. 66: * 67: * @param obj the object to compare. 68: * @return true if the object is a {@link OpenMBeanInfo} 69: * instance, 70: * <code>className.equals(object.getClassName())</code> 71: * and each info class has an equal in the other object. 72: */ 73: boolean equals(Object obj); 74: 75: /** 76: * Returns descriptions of each of the attributes provided by this 77: * management bean. The elements should be implementations of the 78: * {@link OpenMBeanAttributeInfo} class. 79: * 80: * @return an array of {@link OpenMBeanAttributeInfo} objects, 81: * representing the attributes emitted by this 82: * management bean. 83: */ 84: MBeanAttributeInfo[] getAttributes(); 85: 86: /** 87: * Returns the class name of the management bean. 88: * 89: * @return the bean's class name. 90: */ 91: String getClassName(); 92: 93: /** 94: * Returns descriptions of each of the constructors provided by this 95: * management bean. The elements should be implementations of the 96: * {@link OpenMBeanConstructorInfo} class. 97: * 98: * @return an array of {@link OpenMBeanConstructorInfo} objects, 99: * representing the constructors emitted by this 100: * management bean. 101: */ 102: MBeanConstructorInfo[] getConstructors(); 103: 104: /** 105: * Returns a description of this operation. 106: * 107: * @return a human-readable description. 108: */ 109: String getDescription(); 110: 111: /** 112: * Returns descriptions of each of the notifications provided by this 113: * management bean. The elements should be implementations of the 114: * {@link OpenMBeanNotificationInfo} class. 115: * 116: * @return an array of {@link OpenMBeanNotificationInfo} objects, 117: * representing the notifications emitted by this 118: * management bean. 119: */ 120: MBeanNotificationInfo[] getNotifications(); 121: 122: /** 123: * Returns descriptions of each of the operations provided by this 124: * management bean. The elements should be implementations of the 125: * {@link OpenMBeanOperationInfo} class. 126: * 127: * @return an array of {@link OpenMBeanOperationInfo} objects, 128: * representing the operations emitted by this 129: * management bean. 130: */ 131: MBeanOperationInfo[] getOperations(); 132: 133: /** 134: * Returns the hashcode of the bean information as the sum of the 135: * hashcodes of the class name and each array (calculated using 136: * java.util.HashSet(<code>java.util.Arrays.asList(signature)).hashCode()</code>). 137: * 138: * @return the hashcode of the bean information. 139: */ 140: int hashCode(); 141: 142: /** 143: * Returns a textual representation of this instance. This 144: * is constructed using the class name 145: * (<code>javax.management.openmbean.OpenMBeanInfo</code>) 146: * along with the class name and textual representations 147: * of each array. 148: * 149: * @return a @link{java.lang.String} instance representing 150: * the instance in textual form. 151: */ 152: String toString(); 153: 154: }