public class RuntimeInformation
extends java.lang.Object
| Constructor and Description |
|---|
RuntimeInformation() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getDefaultApplicationName()
Get the default application name for this JVM.
|
static java.lang.String |
getDefaultHostName()
Get the default host name for this JVM.
|
static java.lang.String |
getMainClassFromCommand(java.lang.String command)
Get the main class from a command string.
|
static java.lang.String |
getMainClassFromEnvironment(java.util.Map<java.lang.String,java.lang.String> env)
Get the main class from environment variables.
|
public static java.lang.String getDefaultHostName()
Returns the local host name or otherwise the local host address. Use the cinnamon.host property to set the host name directly.
public static java.lang.String getDefaultApplicationName()
A best effort attempt at an application name based on main class, which may not work on all
platforms or JVMs. Use the cinnamon.application property to set the application name
directly.
Uses the sun.java.command property, or uses the JAVA_MAIN_CLASS environment
variable, or otherwise defaults to the process identifier from RuntimeMXBean (usually
pid@hostname).
public static java.lang.String getMainClassFromCommand(java.lang.String command)
The command may be either a main class and arguments, or a jar file and arguments.
command - full command stringpublic static java.lang.String getMainClassFromEnvironment(java.util.Map<java.lang.String,java.lang.String> env)
Looks for JAVA_MAIN_CLASS variables. If these have a PID suffix, then uses the variable with the highest PID (most recent).
env - map of environment variablesCinnamon API. Copyright (c) 2015–2021 Lightbend.