You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/04/12 23:21:00 UTC
[jira] [Commented] (GROOVY-9922) Add DGM `getPid`
[ https://issues.apache.org/jira/browse/GROOVY-9922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17319769#comment-17319769 ]
Eric Milles commented on GROOVY-9922:
-------------------------------------
Since the v8 and the v10 implementations do not use the {{Runtime}} instance, would it make sense to define this as a static extension method so you could just call {{Runtime.getPid()}}?
> Add DGM `getPid`
> ----------------
>
> Key: GROOVY-9922
> URL: https://issues.apache.org/jira/browse/GROOVY-9922
> Project: Groovy
> Issue Type: New Feature
> Reporter: Daniel Sun
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 4.0.0-alpha-3
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Sometime we need to know what process id of our running java program, e.g.
> ① shutdown java program via a shell script, e.g. {{kill -15 <pid>}}
> ② attach the current JVM to transform loaded classes on the fly, e.g. {{VirtualMachine.attach("<pid>");}}
> {{Runtime.getRuntime().getPid()}} can help us to achieve the goal.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)