1. /*
  2. * @(#)ClassLoadingMXBean.java 1.11 04/04/20
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.lang.management;
  8. /**
  9. * The management interface for the class loading system of
  10. * the Java virtual machine.
  11. *
  12. * <p> A Java virtual machine has a single instance of the implementation
  13. * class of this interface. This instance implementing this interface is
  14. * an <a href="ManagementFactory.html#MXBean">MXBean</a>
  15. * that can be obtained by calling
  16. * the {@link ManagementFactory#getClassLoadingMXBean} method or
  17. * from the {@link ManagementFactory#getPlatformMBeanServer
  18. * platform <tt>MBeanServer</tt>} method.
  19. *
  20. * <p>The <tt>ObjectName</tt> for uniquely identifying the MXBean for
  21. * the class loading system within an <tt>MBeanServer</tt> is:
  22. * <blockquote>
  23. * {@link ManagementFactory#CLASS_LOADING_MXBEAN_NAME
  24. * <tt>java.lang:type=ClassLoading</tt>}
  25. * </blockquote>
  26. *
  27. * @see <a href="../../../javax/management/package-summary.html">
  28. * JMX Specification.</a>
  29. * @see <a href="package-summary.html#examples">
  30. * Ways to Access MXBeans</a>
  31. *
  32. * @author Mandy Chung
  33. * @version 1.11, 04/20/04
  34. * @since 1.5
  35. */
  36. public interface ClassLoadingMXBean {
  37. /**
  38. * Returns the total number of classes that have been loaded since
  39. * the Java virtual machine has started execution.
  40. *
  41. * @return the total number of classes loaded.
  42. *
  43. */
  44. public long getTotalLoadedClassCount();
  45. /**
  46. * Returns the number of classes that are currently loaded in the
  47. * Java virtual machine.
  48. *
  49. * @return the number of currently loaded classes.
  50. */
  51. public int getLoadedClassCount();
  52. /**
  53. * Returns the total number of classes unloaded since the Java virtual machine
  54. * has started execution.
  55. *
  56. * @return the total number of unloaded classes.
  57. */
  58. public long getUnloadedClassCount();
  59. /**
  60. * Tests if the verbose output for the class loading system is enabled.
  61. *
  62. * @return <tt>true</tt> if the verbose output for the class loading
  63. * system is enabled; <tt>false</tt> otherwise.
  64. */
  65. public boolean isVerbose();
  66. /**
  67. * Enables or disables the verbose output for the class loading
  68. * system. The verbose output information and the output stream
  69. * to which the verbose information is emitted are implementation
  70. * dependent. Typically, a Java virtual machine implementation
  71. * prints a message each time a class file is loaded.
  72. *
  73. * <p>This method can be called by multiple threads concurrently.
  74. * Each invocation of this method enables or disables the verbose
  75. * output globally.
  76. *
  77. * @param value <tt>true</tt> to enable the verbose output;
  78. * <tt>false</tt> to disable.
  79. *
  80. * @exception java.lang.SecurityException if a security manager
  81. * exists and the caller does not have
  82. * ManagementPermission("control").
  83. */
  84. public void setVerbose(boolean value);
  85. }