diff options
| author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-07-02 20:32:43 +0000 |
|---|---|---|
| committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-07-02 20:32:43 +0000 |
| commit | 7db081cf4c4d514b73cb4567b841dbaacee7baa1 (patch) | |
| tree | ec407bb3413d1d1f2a049b61098630faeb7e1d97 /java/lang/management/ManagementFactory.java | |
| parent | 83c52f939a1ebcd235e0c7d12953005e4aeb060a (diff) | |
| download | classpath-7db081cf4c4d514b73cb4567b841dbaacee7baa1.tar.gz | |
2006-07-02 Andrew John Hughes <gnu_andrew@member.fsf.org>generics-merge-20060702
* NEWS:
Updated to include VMCompilationMXBeanImpl.
* doc/vmintegration.texinfo:
Likewise, along with update to VMMemoryMXBeanImpl
as below.
* examples/gnu/classpath/examples/management/TestCompilation.java,
* gnu/java/lang/management/CompilationMXBeanImpl.java,
* java/lang/management/CompilationMXBeanImpl.java:
New files.
* java/lang/management/ManagementFactory.java:
(getCompilationMXBean()): Implemented.
* vm/reference/gnu/java/lang/management/VMCompilationMXBeanImpl.java:
New file.
* vm/reference/gnu/java/lang/management/VMMemoryMXBeanImpl.java:
(getHeapMemoryUsage()): Added default implementation.
Diffstat (limited to 'java/lang/management/ManagementFactory.java')
| -rw-r--r-- | java/lang/management/ManagementFactory.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/java/lang/management/ManagementFactory.java b/java/lang/management/ManagementFactory.java index 915ca50c1..6e8010089 100644 --- a/java/lang/management/ManagementFactory.java +++ b/java/lang/management/ManagementFactory.java @@ -37,7 +37,10 @@ exception statement from your version. */ package java.lang.management; +import gnu.classpath.SystemProperties; + import gnu.java.lang.management.ClassLoadingMXBeanImpl; +import gnu.java.lang.management.CompilationMXBeanImpl; import gnu.java.lang.management.OperatingSystemMXBeanImpl; import gnu.java.lang.management.MemoryMXBeanImpl; import gnu.java.lang.management.RuntimeMXBeanImpl; @@ -89,6 +92,11 @@ public class ManagementFactory private static MemoryMXBean memoryBean; /** + * The compilation bean (may remain null). + */ + private static CompilationMXBean compilationBean; + + /** * Private constructor to prevent instance creation. */ private ManagementFactory() {} @@ -163,4 +171,22 @@ public class ManagementFactory return memoryBean; } + /** + * Returns the compilation bean for the running + * virtual machine, if supported. Otherwise, + * it returns <code>null</code>. + * + * @return an instance of {@link CompilationMXBean} for + * this virtual machine, or <code>null</code> + * if the virtual machine doesn't include + * a Just-In-Time (JIT) compiler. + */ + public static CompilationMXBean getCompilationMXBean() + { + if (compilationBean == null && + SystemProperties.getProperty("gnu.java.compiler.name") != null) + compilationBean = new CompilationMXBeanImpl(); + return compilationBean; + } + } |
