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>
 | 
			
		||||
 | 
			
		||||
        * Port hpux impl to ia64 arch
 | 
			
		||||
 | 
			
		||||
@ -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,9 +369,17 @@ 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 this.processFinder.findSingleProcess(pid);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Get process memory info.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user