-
- All Implemented Interfaces:
public class JvmObject with utilities to gather information about the running JVM.
TODO.
TODO Add JVM exception handler to add information on known exceptions. I.e: Classpath handler not registered with information on how to fix it (call
ClasspathHandler.registerHandler())
-
-
Field Summary
Fields Modifier and Type Field Description private final TimeZonetimeZoneprivate final Charsetcharsetprivate final Localelocaleprivate final Stringhostnameprivate final Stringipprivate final Stringidprivate final Stringnameprivate final Stringversionprivate final IntegercpuCountprivate final Stringtimezoneprivate final StringlocaleCodepublic final static JvmINSTANCE
-
Method Summary
Modifier and Type Method Description final StringinitialMemory()final StringusedMemory()final Stringuptime()final <T extends Any> TsystemSetting(KClass<T> type, String name)final <T extends Any> TsystemSetting(String name)final BooleansystemFlag(String name)final TimeZonegetTimeZone()Default timezone. final CharsetgetCharset()Default character set. final LocalegetLocale()Default locale for this instance of the Java Virtual Machine. final StringgetHostname()The hostname of the machine running this program. final StringgetIp()The IP address of the machine running this program. final StringgetId()ID representing the running Java virtual machine final StringgetName()Name of the JVM running this program. final StringgetVersion()Java version aka language level. final IntegergetCpuCount()Number of processors available to the Java virtual machine. final StringgetTimezone()User Time Zone property. final StringgetLocaleCode()User locale consist of 2-letter language code, 2-letter country code and file encoding. -
-
Method Detail
-
initialMemory
final String initialMemory()
-
usedMemory
final String usedMemory()
-
systemSetting
final <T extends Any> T systemSetting(String name)
-
systemFlag
final Boolean systemFlag(String name)
-
getTimeZone
final TimeZone getTimeZone()
Default timezone. TODO Defining this lazily fails in macOS
-
getCharset
final Charset getCharset()
Default character set.
-
getHostname
final String getHostname()
The hostname of the machine running this program.
-
getName
final String getName()
Name of the JVM running this program. For example: OpenJDK 64-Bit Server VM.
-
getVersion
final String getVersion()
Java version aka language level. For example: 11
-
getCpuCount
final Integer getCpuCount()
Number of processors available to the Java virtual machine.
-
getTimezone
final String getTimezone()
User Time Zone property. Can be set with -Duser.timezone JVM argument.
-
getLocaleCode
final String getLocaleCode()
User locale consist of 2-letter language code, 2-letter country code and file encoding.
-
-
-
-