Example usage for org.apache.commons.lang3 SystemUtils JAVA_VM_VENDOR

List of usage examples for org.apache.commons.lang3 SystemUtils JAVA_VM_VENDOR

Introduction

In this page you can find the example usage for org.apache.commons.lang3 SystemUtils JAVA_VM_VENDOR.

Prototype

String JAVA_VM_VENDOR

To view the source code for org.apache.commons.lang3 SystemUtils JAVA_VM_VENDOR.

Click Source Link

Document

The java.vm.vendor System Property.

Usage

From source file:net.centro.rtb.monitoringcenter.infos.JvmInfo.java

public static JvmInfo create() {
    JvmInfo jvmInfo = new JvmInfo();

    jvmInfo.specVersion = SystemUtils.JAVA_SPECIFICATION_VERSION;
    jvmInfo.classVersion = SystemUtils.JAVA_CLASS_VERSION;
    jvmInfo.jreVersion = SystemUtils.JAVA_VERSION;
    jvmInfo.jreVendor = SystemUtils.JAVA_VENDOR;
    jvmInfo.vmName = SystemUtils.JAVA_VM_NAME;
    jvmInfo.vmVendor = SystemUtils.JAVA_VM_VENDOR;
    jvmInfo.vmVersion = SystemUtils.JAVA_VM_VERSION;

    RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
    jvmInfo.inputArguments = new ArrayList<>(runtimeMXBean.getInputArguments());
    jvmInfo.startedTimestamp = new Date(runtimeMXBean.getStartTime());

    jvmInfo.defaultTimeZone = TimeZone.getDefault().getID();
    jvmInfo.defaultCharset = Charset.defaultCharset().displayName();

    return jvmInfo;
}

From source file:org.lenskit.cli.Main.java

public static void main(String[] args) {
    ArgumentParser parser = ArgumentParsers.newArgumentParser("lenskit")
            .description("Work with LensKit recommenders and data.");
    Logging.addLoggingGroup(parser);//from  w  w  w  .jav a 2s  .c om

    Subparsers subparsers = parser.addSubparsers().metavar("COMMAND").title("commands");
    ServiceLoader<Command> loader = ServiceLoader.load(Command.class);
    for (Command cmd : loader) {
        Subparser cp = subparsers.addParser(cmd.getName()).help(cmd.getHelp()).setDefault("command", cmd);
        cmd.configureArguments(cp);
    }

    try {
        Namespace options = parser.parseArgs(args);
        Logging.configureLogging(options);
        Runtime rt = Runtime.getRuntime();
        logger.info("Starting LensKit {} on Java {} from {}", LenskitInfo.lenskitVersion(),
                SystemUtils.JAVA_VERSION, SystemUtils.JAVA_VENDOR);
        logger.debug("Built from Git revision {}", LenskitInfo.getHeadRevision());
        logger.debug("Using VM '{}' version {} from {}", SystemUtils.JAVA_VM_NAME, SystemUtils.JAVA_VM_VERSION,
                SystemUtils.JAVA_VM_VENDOR);
        logger.info("Have {} processors and heap limit of {} MiB", rt.availableProcessors(),
                rt.maxMemory() >> 20);
        Command cmd = options.get("command");
        cmd.execute(options);
        logger.info("If you use LensKit in published research, please see http://lenskit.org/research/");
    } catch (ArgumentParserException e) {
        parser.handleError(e);
        System.exit(1);
    } catch (Exception e) {
        logger.error("error running command: " + e, e);
        System.exit(2);
    }
}