org.glassfish.gmbal
Annotation Type AMXMetadata


@Documented
@Target(value=TYPE)
@Retention(value=RUNTIME)
@Inherited
public @interface AMXMetadata

Annotation to contol exactly how the type value in the ObjectName is extracted from a class when registering an instance of that class. The absence of this annotation is the same as the default values. Note that this is simply an application of the general @DescriptorKey mechanism, but these particular metadata attributes control some of the behavior of the AMXMBeanInterface API.

Note that supportsAdoption is not included here, because that attribute is always false for gmbal.

Author:
ken

Optional Element Summary
 java.lang.String genericInterfaceName
          Return the generic AMXMBeanInterface interface to be used.
 java.lang.String group
          String denoting classification of MBean.
 boolean immutableInfo
          True if the MBeanInfo is invariant, that is, has the same value for the lifetime of the MBean.
 java.lang.String interfaceClassName
          Defines the name of the interface to use when generating a proxy for this class.
 boolean isSingleton
          True if only one MBean of this type may be created inside the same parent container
 java.lang.String[] subTypes
          Return the list of types that are legal as types of children of this type.
 java.lang.String type
          An explicit type to use for the MBean.
 

isSingleton

@DescriptorKey(value=)
public abstract boolean isSingleton
True if only one MBean of this type may be created inside the same parent container

Returns:
whether or not this MBean must be the only one of its type.
Default:
false

group

@DescriptorKey(value=)
public abstract java.lang.String group
String denoting classification of MBean. Predefined values are configuration, monitoring, jsr77, utility, and other.

Returns:
The group type.
Default:
"other"

subTypes

@DescriptorKey(value=)
public abstract java.lang.String[] subTypes
Return the list of types that are legal as types of children of this type. If unknown, must be an empty array.

Returns:
Array of child types
Default:
{}

genericInterfaceName

@DescriptorKey(value=)
public abstract java.lang.String genericInterfaceName
Return the generic AMXMBeanInterface interface to be used.

Returns:
name of interface to use.
Default:
"org.glassfish.admin.amx.core.AMXProxy"

immutableInfo

@DescriptorKey(value=)
public abstract boolean immutableInfo
True if the MBeanInfo is invariant, that is, has the same value for the lifetime of the MBean. This may be used as a hint to clients that the MBeanInfo can be cached.

Returns:
True if the MBeanInfo is invariant
Default:
true

interfaceClassName

@DescriptorKey(value=)
public abstract java.lang.String interfaceClassName
Defines the name of the interface to use when generating a proxy for this class. Defaults to a generic interface.

Returns:
The interface class name for a proxy.
Default:
""

type

@DescriptorKey(value="type")
public abstract java.lang.String type
An explicit type to use for the MBean.

Note that this is NOT part of the AMXMBeanInterface-defined metadata, but gmbal needs it here to have a place to override the type.

Gmbal determines the type name as follows:

  1. If the class has a final static field of type String with the name "AMX_TYPE", the value of the field is the type name.
  2. Otherwise, if the class has an @AMXMetadata annotations, and the value of the type is not "", the value of the type is the type name.
  3. Otherwise, if the package prefix of the class name matches one of the type prefixes added by an stripPrefix call to the ManagedObjectManager, the type name is the full class name with the matching prefix removed.
  4. Otherwise, if the stripPackagePrefix method was called on the ManagedObjectManager, the type name is the class name without any package prefixes.
  5. Otherwise, the type name is the class name.

Returns:
The type for this MBean.
Default:
""