1. /*
  2. * @(#)CompilationMXBean.java 1.10 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 compilation 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#getCompilationMXBean} 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 compilation system within an MBeanServer is:
  22. * <blockquote>
  23. * {@link ManagementFactory#COMPILATION_MXBEAN_NAME
  24. * <tt>java.lang:type=Compilation</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.10, 04/20/04
  34. * @since 1.5
  35. */
  36. public interface CompilationMXBean {
  37. /**
  38. * Returns the name of the Just-in-time (JIT) compiler.
  39. *
  40. * @return the name of the JIT compiler.
  41. */
  42. public java.lang.String getName();
  43. /**
  44. * Tests if the Java virtual machine supports the monitoring of
  45. * compilation time.
  46. *
  47. * @return <tt>true</tt> if the monitoring of compilation time is
  48. * supported ; <tt>false</tt> otherwise.
  49. */
  50. public boolean isCompilationTimeMonitoringSupported();
  51. /**
  52. * Returns the approximate accumlated elapsed time (in milliseconds)
  53. * spent in compilation.
  54. * If multiple threads are used for compilation, this value is
  55. * summation of the approximate time that each thread spent in compilation.
  56. *
  57. * <p>This method is optionally supported by the platform.
  58. * A Java virtual machine implementation may not support the compilation
  59. * time monitoring. The {@link #isCompilationTimeMonitoringSupported}
  60. * method can be used to determine if the Java virtual machine
  61. * supports this operation.
  62. *
  63. * <p> This value does not indicate the level of performance of
  64. * the Java virtual machine and is not intended for performance comparisons
  65. * of different virtual machine implementations.
  66. * The implementations may have different definitions and different
  67. * measurements of the compilation time.
  68. *
  69. * @return Compilation time in milliseconds
  70. * @throws java.lang.UnsupportedOperationException if the Java
  71. * virtual machine does not support
  72. * this operation.
  73. *
  74. */
  75. public long getTotalCompilationTime();
  76. }