Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1035193 // isHotspotVMOptionSet

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (7690L) is out of date.

sO getHotspotVMOption(S optionName) {
  pcall-short {
    S MANAGEMENT_FACTORY_CLASS = "java.lang.management.ManagementFactory";
    S HOTSPOT_BEAN_CLASS = "com.sun.management.HotSpotDiagnosticMXBean";
  
    Class<?> beanClazz = Class.forName(HOTSPOT_BEAN_CLASS);
    O hotSpotBean = call(Class.forName(MANAGEMENT_FACTORY_CLASS), "getPlatformMXBean", beanClazz);
    if (hotSpotBean == null) null;
    O vmOption = call(hotSpotBean, "getVMOption", optionName);
    ret call(vmOption, "getValue");
  }
  
  null;
}

Author comment

Began life as a copy of #1011522

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035193
Snippet name: isHotspotVMOptionSet
Eternal ID of this version: #1035193/4
Text MD5: 3aefa7fe4f264715b4feada60eb363c3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-11 19:46:38
Source code size: 527 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 143 / 219
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)