Package com.amazonaws.jmx
Enum MBeans
- All Implemented Interfaces:
Serializable
,Comparable<MBeans>
,java.lang.constant.Constable
MBean related utilities.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Method Summary
Modifier and TypeMethodDescriptionstatic MBeanServer
Returns the first registered MBean server, or the platform MBean server if there is none.static boolean
isRegistered
(String objectName) Returns true if an MBean identified by the specified object name is already registered with the first MBean server, or the platform MBean server if there is no explicitly registered MBean server; false otherwise.static <T> boolean
registerMBean
(String objectName, T mbean) Registers the given MBean under the given object name to the first registered MBean server, or the platform MBean server if there is no explicitly registered MBean server.static <T> boolean
unregisterMBean
(String objectName) Unregisters the MBean under the given object name to the first MBean server, or the platform MBean server if there is no explicitly registered MBean server.static MBeans
Returns the enum constant of this type with the specified name.static MBeans[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
registerMBean
public static <T> boolean registerMBean(String objectName, T mbean) throws MBeanRegistrationException Registers the given MBean under the given object name to the first registered MBean server, or the platform MBean server if there is no explicitly registered MBean server.- Returns:
- true if the registration succeeded, or false if an MBean already exists under the given object name.
- Throws:
MBeanRegistrationException
- The preRegister (MBeanRegistration interface) method of the MBean has thrown an exception. The MBean will not be registered.
-
unregisterMBean
Unregisters the MBean under the given object name to the first MBean server, or the platform MBean server if there is no explicitly registered MBean server.- Returns:
- true if the unregistration succeeded, or false if the MBean doesn't exist under the given object name.
- Throws:
MBeanRegistrationException
- Wraps exceptions thrown by the preRegister(), preDeregister() methods of the MBeanRegistration interface.
-
isRegistered
Returns true if an MBean identified by the specified object name is already registered with the first MBean server, or the platform MBean server if there is no explicitly registered MBean server; false otherwise. -
getMBeanServer
Returns the first registered MBean server, or the platform MBean server if there is none.
-