Class MBeanUtils


  • public class MBeanUtils
    extends Object
    Public utility methods in support of the server side MBeans implementation.
    Author:
    Craig R. McClanahan, Amy Roh
    • Constructor Detail

      • MBeanUtils

        public MBeanUtils()
    • Method Detail

      • createMBean

        public static DynamicMBean createMBean​(ContextEnvironment environment)
                                        throws Exception
        Create, register, and return an MBean for this ContextEnvironment object.
        Parameters:
        environment - The ContextEnvironment to be managed
        Returns:
        a new MBean
        Throws:
        Exception - if an MBean cannot be created or registered
      • createMBean

        public static DynamicMBean createMBean​(ContextResource resource)
                                        throws Exception
        Create, register, and return an MBean for this ContextResource object.
        Parameters:
        resource - The ContextResource to be managed
        Returns:
        a new MBean
        Throws:
        Exception - if an MBean cannot be created or registered
      • createMBean

        public static DynamicMBean createMBean​(ContextResourceLink resourceLink)
                                        throws Exception
        Create, register, and return an MBean for this ContextResourceLink object.
        Parameters:
        resourceLink - The ContextResourceLink to be managed
        Returns:
        a new MBean
        Throws:
        Exception - if an MBean cannot be created or registered
      • createRegistry

        public static Registry createRegistry()
        Create and configure (if necessary) and return the registry of managed object descriptions.
        Returns:
        the singleton registry
      • createServer

        public static MBeanServer createServer()
        Create and configure (if necessary) and return the MBeanServer with which we will be registering our DynamicMBean implementations.
        Returns:
        the singleton MBean server
      • destroyMBean

        public static void destroyMBean​(ContextEnvironment environment)
                                 throws Exception
        Deregister the MBean for this ContextEnvironment object.
        Parameters:
        environment - The ContextEnvironment to be managed
        Throws:
        Exception - if an MBean cannot be deregistered
      • destroyMBean

        public static void destroyMBean​(ContextResource resource)
                                 throws Exception
        Deregister the MBean for this ContextResource object.
        Parameters:
        resource - The ContextResource to be managed
        Throws:
        Exception - if an MBean cannot be deregistered
      • destroyMBean

        public static void destroyMBean​(ContextResourceLink resourceLink)
                                 throws Exception
        Deregister the MBean for this ContextResourceLink object.
        Parameters:
        resourceLink - The ContextResourceLink to be managed
        Throws:
        Exception - if an MBean cannot be deregistered