Sigar.getProc*(String) methods now convert PTQL queries
This commit is contained in:
parent
5c33239e82
commit
4b5a270033
|
@ -1,3 +1,7 @@
|
||||||
|
2006-08-24 Doug MacEachern <dougm@hyperic.com>
|
||||||
|
|
||||||
|
* Sigar.getProc*(String) methods now convert PTQL queries
|
||||||
|
|
||||||
2006-08-04 Doug MacEachern <dougm@hyperic.com>
|
2006-08-04 Doug MacEachern <dougm@hyperic.com>
|
||||||
|
|
||||||
* Port hpux impl to ia64 arch
|
* Port hpux impl to ia64 arch
|
||||||
|
|
|
@ -30,6 +30,8 @@ import java.util.StringTokenizer;
|
||||||
import org.hyperic.jni.ArchLoaderException;
|
import org.hyperic.jni.ArchLoaderException;
|
||||||
import org.hyperic.jni.ArchNotSupportedException;
|
import org.hyperic.jni.ArchNotSupportedException;
|
||||||
|
|
||||||
|
import org.hyperic.sigar.ptql.ProcessFinder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Sigar class provides access to the sigar objects containing
|
* The Sigar class provides access to the sigar objects containing
|
||||||
* system information. The Sigar object itself maintains internal
|
* system information. The Sigar object itself maintains internal
|
||||||
|
@ -78,6 +80,8 @@ public class Sigar implements SigarProxy {
|
||||||
private Cpu lastCpu;
|
private Cpu lastCpu;
|
||||||
private Cpu[] lastCpuList;
|
private Cpu[] lastCpuList;
|
||||||
|
|
||||||
|
private ProcessFinder processFinder = null;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
String nativeVersion = "unknown";
|
String nativeVersion = "unknown";
|
||||||
String nativeBuildDate = "unknown";
|
String nativeBuildDate = "unknown";
|
||||||
|
@ -365,8 +369,16 @@ public class Sigar implements SigarProxy {
|
||||||
if (pid.equals("$$")) {
|
if (pid.equals("$$")) {
|
||||||
return getPid();
|
return getPid();
|
||||||
}
|
}
|
||||||
|
else if (Character.isDigit(pid.charAt(0))) {
|
||||||
|
return Long.parseLong(pid);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (this.processFinder == null) {
|
||||||
|
this.processFinder = new ProcessFinder(this);
|
||||||
|
}
|
||||||
|
|
||||||
return Long.parseLong(pid);
|
return this.processFinder.findSingleProcess(pid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue