1 /* 2 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. 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. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 27 28 package com.sun.org.glassfish.gmbal; 29 30 import java.util.Map; 31 import com.sun.org.glassfish.external.amx.AMX; 32 33 34 /** Base interface supported by all AMXMBeanInterface MBeans. All MBeans generated by 35 * gmbal comply with this interface, which means that the attributes and 36 * operations defined in this Java interface all appear in each 37 * MBean generated by calling ManagedObjectManager.register. 38 * 39 * @author LLoyd Chambers 40 * @author Ken Cavanaugh 41 * 42 */ 43 @ManagedObject 44 @Description( "Base interface for any MBean that works in the AMX framework" ) 45 public interface AMXMBeanInterface { 46 /** Get all metadata about this MBean. 47 * @return The descriptor, which will be a ModelMBeanInfoSupport instance. 48 */ 49 public Map<String,?> getMeta(); 50 51 /** Usually the same as the ObjectName 'name' property, but can differ 52 if the actual name contains characters that must be escaped for an ObjectName and/or 53 if the MBean has a mutable name attribute. 54 The type property can be obtained from the ObjectName */ 55 @ManagedAttribute( id=AMX.ATTR_NAME ) 56 @Description( "Return the name of this MBean.") 57 public String getName(); 58 59 /** "go up one level": the MBean containing this one, can be null for root 60 * @return The container of this MBean (null if already at root). 61 */ 62 @ManagedAttribute( id=AMX.ATTR_PARENT ) 63 @Description( "The container that contains this MBean" ) 64 public AMXMBeanInterface getParent(); 65 66 /** Containment hierarchy: 67 Get all AMXMBeanInterface contained by this one, in no particular order. 68 Valid only if isContainer(). 69 * Note that using an array sidesteps Map/Set/OpenType issues 70 * @return All children of this AMXMBeanInterface MBean. 71 */ 72 @ManagedAttribute( id=AMX.ATTR_CHILDREN ) 73 @Description( "All children of this AMX MBean") 74 public AMXMBeanInterface[] getChildren(); 75 }