Enum MBeans

java.lang.Object
java.lang.Enum<MBeans>
com.amazonaws.jmx.MBeans
All Implemented Interfaces:
Serializable, Comparable<MBeans>, java.lang.constant.Constable

public enum MBeans extends Enum<MBeans>
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 Type
    Method
    Description
    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[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • values

      public static MBeans[] 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

      public static MBeans valueOf(String name)
      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 name
      NullPointerException - 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

      public static <T> boolean unregisterMBean(String objectName) throws MBeanRegistrationException
      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

      public 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.
    • getMBeanServer

      public static MBeanServer getMBeanServer()
      Returns the first registered MBean server, or the platform MBean server if there is none.