diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
| commit | 65bf3316cf384588453604be6b4f0ed3751a8b0f (patch) | |
| tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/gnu/java/lang/management/VMRuntimeMXBeanImpl.java | |
| parent | 8fc56618a84446beccd45b80381cdfe0e94050df (diff) | |
| download | ppe42-gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz ppe42-gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.zip | |
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java/lang/management/VMRuntimeMXBeanImpl.java')
| -rw-r--r-- | libjava/gnu/java/lang/management/VMRuntimeMXBeanImpl.java | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/libjava/gnu/java/lang/management/VMRuntimeMXBeanImpl.java b/libjava/gnu/java/lang/management/VMRuntimeMXBeanImpl.java index bbfceb6ffd7..05d368a9e24 100644 --- a/libjava/gnu/java/lang/management/VMRuntimeMXBeanImpl.java +++ b/libjava/gnu/java/lang/management/VMRuntimeMXBeanImpl.java @@ -39,6 +39,9 @@ package gnu.java.lang.management; import gnu.classpath.SystemProperties; +import java.net.InetAddress; +import java.net.UnknownHostException; + /** * Provides access to information about the virtual machine. * @@ -55,10 +58,7 @@ final class VMRuntimeMXBeanImpl * * @return the command-line arguments. */ - static String[] getInputArguments() - { - return new String[0]; - } + static native String[] getInputArguments(); /** * Returns a developer-chosen name for the virtual @@ -75,8 +75,18 @@ final class VMRuntimeMXBeanImpl */ static String getName() { + String hostName; + try + { + hostName = InetAddress.getLocalHost().getHostName(); + } + catch (UnknownHostException e) + { + hostName = "Unknown host"; + } return SystemProperties.getProperty("java.vm.name") + " " + - SystemProperties.getProperty("java.vm.version"); + SystemProperties.getProperty("java.vm.version") + " [" + + getPID() + "@" + hostName + "]"; } /** @@ -87,9 +97,13 @@ final class VMRuntimeMXBeanImpl * * @return the VM start time. */ - static long getStartTime() - { - return -1; - } + static native long getStartTime(); + + /** + * The process identifier of the runtime. + * + * @return the PID of the runtime. + */ + private static native long getPID(); } |

