Sigar.getProc*(String) methods now convert PTQL queries

This commit is contained in:
Doug MacEachern committed 2006-08-24 22:49:26 +00:00
1 parent 5c33239e82
commit 4b5a270033
2 files changed
+17 -1

No files matched your search

+13 -1
View File
@@ -30,6 +30,8 @@ import java.util.StringTokenizer;
import org.hyperic.jni.ArchLoaderException;
import org.hyperic.jni.ArchNotSupportedException;
import org.hyperic.sigar.ptql.ProcessFinder;
/**
* The Sigar class provides access to the sigar objects containing
* system information. The Sigar object itself maintains internal
@@ -78,6 +80,8 @@ public class Sigar implements SigarProxy {
private Cpu lastCpu;
private Cpu[] lastCpuList;
private ProcessFinder processFinder = null;
static {
String nativeVersion = "unknown";
String nativeBuildDate = "unknown";
@@ -365,8 +369,16 @@ public class Sigar implements SigarProxy {
if (pid.equals("$$")) {
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);
}
}
/**