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

10
LINES

< > BotCompany Repo | #1001122 // getPID

JavaX fragment (include)

1  
static S processID_cached;
2  
3  
// try to get our current process ID
4  
static S getPID() {
5  
  if (processID_cached == null) {
6  
    S name = ManagementFactory.getRuntimeMXBean().getName();
7  
    processID_cached = name.replaceAll("@.*", "");
8  
  }
9  
  ret processID_cached;
10  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001122
Snippet name: getPID
Eternal ID of this version: #1001122/1
Text MD5: 88c88b82a932ca6f198d5a004137ef3b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-26 13:39:23
Source code size: 269 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 542 / 2335
Referenced in: [show references]