use of java.lang.management.RuntimeMXBean in project incubator-gobblin by apache.
the class JvmUtils method getJvmInputArguments.
/**
* Gets the input arguments passed to the JVM.
* @return The input arguments.
*/
public static String getJvmInputArguments() {
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
List<String> arguments = runtimeMxBean.getInputArguments();
return String.format("JVM Input Arguments: %s", JOINER.join(arguments));
}
use of java.lang.management.RuntimeMXBean in project jvm-profiler by uber-common.
the class ProcessUtils method getJvmInputArguments.
public static List<String> getJvmInputArguments() {
RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
List<String> jvmArgs = runtimeMXBean.getInputArguments();
return jvmArgs == null ? new ArrayList<>() : jvmArgs;
}
use of java.lang.management.RuntimeMXBean in project tesb-rt-se by Talend.
the class MetterCatcherUtils method getPid.
public static long getPid() {
RuntimeMXBean mx = ManagementFactory.getRuntimeMXBean();
// $NON-NLS-1$
String[] mxNameTable = mx.getName().split("@");
if (mxNameTable.length == 2) {
return Long.parseLong(mxNameTable[0]);
} else {
return Thread.currentThread().getId();
}
}
use of java.lang.management.RuntimeMXBean in project tesb-rt-se by Talend.
the class StatCatcherUtils method getPid.
public static long getPid() {
RuntimeMXBean mx = ManagementFactory.getRuntimeMXBean();
// $NON-NLS-1$
String[] mxNameTable = mx.getName().split("@");
if (mxNameTable.length == 2) {
return Long.parseLong(mxNameTable[0]);
} else {
return Thread.currentThread().getId();
}
}
use of java.lang.management.RuntimeMXBean in project Mycat_plus by coderczp.
the class EnvironmentInformation method getJvmStartupOptionsArray.
/**
* Gets the system parameters and environment parameters that were passed to the JVM on startup.
*
* @return The options passed to the JVM on startup.
*/
public static String[] getJvmStartupOptionsArray() {
try {
RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
List<String> options = bean.getInputArguments();
return options.toArray(new String[options.size()]);
} catch (Throwable t) {
return new String[0];
}
}
Aggregations