325N/A/*
325N/A * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325N/A *
325N/A * This code is free software; you can redistribute it and/or modify it
325N/A * under the terms of the GNU General Public License version 2 only, as
325N/A * published by the Free Software Foundation. Oracle designates this
325N/A * particular file as subject to the "Classpath" exception as provided
325N/A * by Oracle in the LICENSE file that accompanied this code.
325N/A *
325N/A * This code is distributed in the hope that it will be useful, but WITHOUT
325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325N/A * version 2 for more details (a copy is included in the LICENSE file that
325N/A * accompanied this code).
325N/A *
325N/A * You should have received a copy of the GNU General Public License version
325N/A * 2 along with this work; if not, write to the Free Software Foundation,
325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325N/A *
325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
325N/A * or visit www.oracle.com if you need additional information or have any
325N/A * questions.
325N/A */
325N/A
325N/A
325N/Apackage com.sun.org.glassfish.gmbal;
325N/A
325N/Aimport java.lang.annotation.Documented ;
325N/Aimport java.lang.annotation.Inherited ;
325N/Aimport java.lang.annotation.Target ;
325N/Aimport java.lang.annotation.ElementType ;
325N/Aimport java.lang.annotation.Retention ;
325N/Aimport java.lang.annotation.RetentionPolicy ;
325N/A
325N/Aimport com.sun.org.glassfish.external.amx.AMX ;
325N/A
325N/A/** Annotation to contol exactly how the type value in the ObjectName
325N/A * is extracted from a class when registering an instance of that class.
325N/A * The absence of this annotation is the same as the default values.
325N/A * Note that this is simply an application of the general @DescriptorKey
325N/A * mechanism, but these particular metadata attributes control some of the
325N/A * behavior of the AMXMBeanInterface API.
325N/A * <p>Note that supportsAdoption is not included here, because that attribute
325N/A * is always false for gmbal.
325N/A *
325N/A * @author ken
325N/A */
325N/A@Documented
325N/A@Target(ElementType.TYPE)
325N/A@Retention(RetentionPolicy.RUNTIME)
325N/A@Inherited
325N/Apublic @interface AMXMetadata {
325N/A /** True if only one MBean of this type may be created inside the same
325N/A * parent container
325N/A *
325N/A * @return whether or not this MBean must be the only one of its type.
325N/A */
325N/A @DescriptorKey( AMX.DESC_IS_SINGLETON )
325N/A boolean isSingleton() default false ;
325N/A
325N/A /** String denoting classification of MBean. Predefined values are
325N/A * configuration, monitoring, jsr77, utility, and other.
325N/A * @return The group type.
325N/A */
325N/A @DescriptorKey( AMX.DESC_GROUP )
325N/A String group() default "other" ;
325N/A
325N/A /** Return the list of types that are legal as types of children of this
325N/A * type. If unknown, must be an empty array.
325N/A * @return Array of child types
325N/A */
325N/A @DescriptorKey( AMX.DESC_SUB_TYPES )
325N/A String[] subTypes() default {} ;
325N/A
325N/A /** Return the generic AMXMBeanInterface interface to be used.
325N/A * @return name of interface to use.
325N/A */
325N/A @DescriptorKey( AMX.DESC_GENERIC_INTERFACE_NAME )
325N/A String genericInterfaceName() default "com.sun.org.glassfish.admin.amx.core.AMXProxy" ;
325N/A
325N/A /** True if the MBeanInfo is invariant, that is, has the same
325N/A * value for the lifetime of the MBean. This may be used as a hint
325N/A * to clients that the MBeanInfo can be cached.
325N/A *
325N/A * @return True if the MBeanInfo is invariant
325N/A */
325N/A @DescriptorKey( AMX.DESC_STD_IMMUTABLE_INFO )
325N/A boolean immutableInfo() default true ;
325N/A
325N/A /** Defines the name of the interface to use when generating a proxy
325N/A * for this class. Defaults to a generic interface.
325N/A * @return The interface class name for a proxy.
325N/A */
325N/A @DescriptorKey( AMX.DESC_STD_INTERFACE_NAME )
325N/A String interfaceClassName() default "" ;
325N/A
325N/A /** An explicit type to use for the MBean.
325N/A * <p>
325N/A * Note that this is NOT part of the AMXMBeanInterface-defined metadata, but gmbal
325N/A * needs it here to have a place to override the type.
325N/A * <p>
325N/A * Gmbal determines the type name as follows:
325N/A * <ol>
325N/A * <li>If the class has a final static field of type String with the
325N/A * name "AMX_TYPE", the value of the field is the type name.
325N/A * <li>Otherwise, if the class has an @AMXMetadata annotations, and the
325N/A * value of the type is not "", the value of the type is the type name.
325N/A * <li>Otherwise, if the package prefix of the class name matches one of
325N/A * the type prefixes added by an stripPrefix call to the ManagedObjectManager,
325N/A * the type name is the full class name with the matching prefix removed.
325N/A * <li>Otherwise, if the stripPackagePrefix method was called on the
325N/A * ManagedObjectManager, the type name is the class name without any
325N/A * package prefixes.
325N/A * <li>Otherwise, the type name is the class name.
325N/A * </ol>
325N/A * @return The type for this MBean.
325N/A */
325N/A @DescriptorKey( "type" )
325N/A String type() default "" ;
325N/A}