From 10d50d8916bda702b901211deaaece410baac40e Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 21 Apr 2007 23:56:43 +0000 Subject: [PATCH] move proxy usage to ProcessFinder --- .../src/org/hyperic/sigar/ptql/ProcessFinder.java | 14 ++++++-------- .../org/hyperic/sigar/ptql/SigarProcessQuery.java | 12 ------------ 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/bindings/java/src/org/hyperic/sigar/ptql/ProcessFinder.java b/bindings/java/src/org/hyperic/sigar/ptql/ProcessFinder.java index 3a31c4ef..182f9fd6 100644 --- a/bindings/java/src/org/hyperic/sigar/ptql/ProcessFinder.java +++ b/bindings/java/src/org/hyperic/sigar/ptql/ProcessFinder.java @@ -34,9 +34,10 @@ public class ProcessFinder { this.proxy.getPid(); } - /** - * @deprecated - */ + private Sigar getSigar() { + return SigarProxyCache.getSigar(this.proxy); + } + public long findSingleProcess(String query) throws SigarException, SigarNotImplementedException { @@ -49,15 +50,12 @@ public class ProcessFinder { } } - /** - * @deprecated - */ public long findSingleProcess(ProcessQuery query) throws SigarException, SigarNotImplementedException, MalformedQueryException { if (query instanceof SigarProcessQuery) { - return ((SigarProcessQuery)query).findProcess(this.proxy); + return ((SigarProcessQuery)query).findProcess(getSigar()); } throw new SigarNotImplementedException(); @@ -98,7 +96,7 @@ public class ProcessFinder { throws SigarException, SigarNotImplementedException { if (query instanceof SigarProcessQuery) { - return ((SigarProcessQuery)query).findProcesses(this.proxy); + return ((SigarProcessQuery)query).findProcesses(getSigar()); } throw new SigarNotImplementedException(); diff --git a/bindings/java/src/org/hyperic/sigar/ptql/SigarProcessQuery.java b/bindings/java/src/org/hyperic/sigar/ptql/SigarProcessQuery.java index 0ab61c06..6b3f4c48 100644 --- a/bindings/java/src/org/hyperic/sigar/ptql/SigarProcessQuery.java +++ b/bindings/java/src/org/hyperic/sigar/ptql/SigarProcessQuery.java @@ -49,21 +49,9 @@ public class SigarProcessQuery implements ProcessQuery { public native long findProcess(Sigar sigar) throws SigarException, SigarNotImplementedException, MalformedQueryException; - public long findProcess(SigarProxy sigar) - throws SigarException, SigarNotImplementedException, MalformedQueryException { - - return findProcess(SigarProxyCache.getSigar(sigar)); - } - public native long[] findProcesses(Sigar sigar) throws SigarException, SigarNotImplementedException; - public long[] findProcesses(SigarProxy sigar) - throws SigarException, SigarNotImplementedException { - - return findProcesses(SigarProxyCache.getSigar(sigar)); - } - static boolean re(String haystack, String needle) { if (haystack == null) { return false;