com.sun.enterprise.universal.process
Class Jps

java.lang.Object
  extended by com.sun.enterprise.universal.process.Jps

public class Jps
extends java.lang.Object

Run a native process with jps -- get the pid for a running JVM note: dropping in an implementation for jps is not hard.

Author:
bnevins

Method Summary
static int getPid(java.lang.String mainClassName)
          return the platform-specific process-id of a JVM
static java.util.Map<java.lang.String,java.lang.Integer> getProcessTable()
           
static boolean isPid(int apid)
          Is this pid owned by a process?
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(java.lang.String[] args)

getProcessTable

public static final java.util.Map<java.lang.String,java.lang.Integer> getProcessTable()

getPid

public static final int getPid(java.lang.String mainClassName)
return the platform-specific process-id of a JVM

Parameters:
mainClassName - The main class - this is how we identify the right JVM
Returns:
the process id if possible otherwise 0

isPid

public static final boolean isPid(int apid)
Is this pid owned by a process?

Parameters:
apid - the pid of interest
Returns:
whether there is a process running with that id


Copyright © 2012 GlassFish Community. All Rights Reserved.