Interface ClasspathAgentMBean

All Superinterfaces:
ClassLoading, Serializable
All Known Implementing Classes:
ClasspathAgent

public interface ClasspathAgentMBean extends ClassLoading, Serializable
This is the MBean for the ClasspathAgent to be able to register this class for a JMX console like jconsole or visualvm. Originally this interface was part of patterntesting-agent.
Author:
oliver
  • Method Details

    • isActive

      boolean isActive()
      Checks if agent is active. This is true if this class here was started as Java agent.
      Returns:
      true, if started as Java agent
    • getArgs

      String getArgs()
      Get the arguments from the call as agent.
      Returns:
      the args
    • getLoadedClasses

      Class<?>[] getLoadedClasses(ClassLoader classloader)
      Gets the loaded classes.
      Parameters:
      classloader - the classloader
      Returns:
      the loaded classes
    • logLoadedClasses

      void logLoadedClasses()
      Prints the loaded classes to the log output.
      Since:
      1.5
    • dumpLoadedClasses

      File dumpLoadedClasses()
      This operation dumps the loaded classes to a temporary file with the prefix "dumpLoadedClasses" and the extension ".txt".

      To be able to see the name of the temporary file in the 'jconsole' it should be returned as value.

      Returns:
      the temporary file
      Since:
      1.5
    • getAllClasses

      String[] getAllClasses()
      Gets all classes which are available thru the classpath
      Returns:
      all classes of the classpath
      Since:
      3.0
    • getUnusedClasses

      String[] getUnusedClasses()
      Gets unused classes. If you want to find dead classed look at the unused classes.
      Returns:
      all unused classes of the classpath
      Since:
      3.0
    • getDumpURI

      URI getDumpURI()
      Returns the URI where a little statistic of loaded and unloaded classes are dumped to.
      Returns:
      dump URI or "dev:/null" if nothing is dumped
      Since:
      3.0
    • setDumpURI

      void setDumpURI(URI dumpURI)
      It is possible to change the URI where the classes are dumped to. If the URI cannot be handled (e.g. it is not a file URI) it will be ignored.
      Parameters:
      dumpURI - e.g. "file://tmp/test.csv"
    • isDumping

      default boolean isDumping()
      Indicates if class statistic is dumped at the end of the application.
      Returns:
      true if class statistic is dumped by agent