Class AMXGlassfish

java.lang.Object
org.glassfish.external.amx.AMXGlassfish

public final class AMXGlassfish extends Object
AMX behavior specific to Glassfish V3.
  • Field Details

  • Constructor Details

    • AMXGlassfish

      public AMXGlassfish(String jmxDomain)
      Anything other than DEFAULT is not supported in Glassfish V3
  • Method Details

    • getGlassfishVersion

      public static String getGlassfishVersion()
      Return a version string, or null if not running in Glassfish
    • amxJMXDomain

      public String amxJMXDomain()
      JMX domain used by AMX MBeans.

      All MBeans in this domain must be AMX-compliant, see http://tinyurl.com/nryoqp = https://glassfish.dev.java.net/nonav/v3/admin/planning/V3Changes/V3_AMX_SPI.html

    • amxSupportDomain

      public String amxSupportDomain()
      JMX domain used by AMX support MBeans. Private use only
    • dasName

      public String dasName()
      name of the Domain Admin Server (DAS) as found in an ObjectName
    • dasConfig

      public String dasConfig()
      name of the Domain Admin Server (DAS) <config>
    • domainRoot

      public ObjectName domainRoot()
      return the ObjectName of the AMX DomainRoot MBean
    • monitoringRoot

      public ObjectName monitoringRoot()
      ObjectName for top-level monitoring MBean (parent of those for each server)
    • serverMon

      public ObjectName serverMon(String serverName)
      ObjectName for top-level monitoring MBean for specified server
    • serverMonForDAS

      public ObjectName serverMonForDAS()
      ObjectName for top-level monitoring MBean for the DAS.
    • newObjectName

      public ObjectName newObjectName(String pp, String type, String name)
      Make a new AMX ObjectName with unchecked exception. name must be null to create a singleton ObjectName. Note that the arguments must not contain the characters
      Parameters:
      pp - The parent part
      type - The ObjectName type
      name - The ObjectName name
      Returns:
      The objectname with pp, type, and (optionally) name.
    • newObjectName

      public ObjectName newObjectName(String s)
      Make a new ObjectName for AMX domain with unchecked exception
    • prop

      private static String prop(String key, String value)
    • getBootAMXMBeanObjectName

      public ObjectName getBootAMXMBeanObjectName()
      ObjectName for BootAMXMBean
    • invokeBootAMX

      public void invokeBootAMX(MBeanServerConnection conn)
      Invoke the bootAMX() method on BootAMXMBean. Upon return, AMX continues to load. A cilent should call invokeWaitAMXReady(javax.management.MBeanServerConnection, javax.management.ObjectName) prior to use.
    • invokeWaitAMXReady

      private static void invokeWaitAMXReady(MBeanServerConnection conn, ObjectName objectName)
      Invoke the waitAMXReady() method on the DomainRoot MBean, which must already be loaded.
    • listenForDomainRoot

      public <T extends MBeanListener.Callback> MBeanListener<T> listenForDomainRoot(MBeanServerConnection server, T callback)
      Listen for the registration of AMX DomainRoot Listening starts automatically.
    • waitAMXReady

      public ObjectName waitAMXReady(MBeanServerConnection server)
      Wait until AMX has loaded and is ready for use.

      This will not cause AMX to load; it will block forever until AMX is ready. In other words, don't call this method unless it's a convenient thread that can wait forever.

    • listenForBootAMX

      public <T extends MBeanListener.Callback> MBeanListener<T> listenForBootAMX(MBeanServerConnection server, T callback)
      Listen for the registration of the BootAMXMBean. Listening starts automatically.
    • bootAMX

      public ObjectName bootAMX(MBeanServerConnection conn) throws IOException
      Ensure that AMX is loaded and ready to use. This method returns only when all AMX subsystems have been loaded. It can be called more than once without ill effect, subsequent calls are ignored.
      Parameters:
      conn - connection to the MBeanServer
      Returns:
      the ObjectName of the domain-root MBean
      Throws:
      IOException
    • bootAMX

      public ObjectName bootAMX(MBeanServer server)