ProcessQueryFactory does not use the SigarProxy object
This commit is contained in:
		
							parent
							
								
									bd6184ae67
								
							
						
					
					
						commit
						9ffbe0fa34
					
				@ -74,7 +74,7 @@ public class ProcessFinder {
 | 
			
		||||
        ProcessFinder finder = new ProcessFinder(sigar);
 | 
			
		||||
 | 
			
		||||
        try {
 | 
			
		||||
            return finder.find(ProcessQueryFactory.getInstance(query, sigar));
 | 
			
		||||
            return finder.find(ProcessQueryFactory.getInstance(query));
 | 
			
		||||
        } catch (QueryLoadException e) {
 | 
			
		||||
            throw new SigarException(e.getMessage());
 | 
			
		||||
        } catch (MalformedQueryException e) {
 | 
			
		||||
 | 
			
		||||
@ -5,7 +5,6 @@ import java.util.Comparator;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.StringTokenizer;
 | 
			
		||||
 | 
			
		||||
import net.hyperic.sigar.SigarProxy;
 | 
			
		||||
import net.hyperic.sigar.util.ReferenceMap;
 | 
			
		||||
 | 
			
		||||
public class ProcessQueryFactory implements Comparator {
 | 
			
		||||
@ -13,14 +12,8 @@ public class ProcessQueryFactory implements Comparator {
 | 
			
		||||
    private static Map cache =
 | 
			
		||||
        ReferenceMap.synchronizedMap();
 | 
			
		||||
 | 
			
		||||
    private SigarProxy sigar = null;
 | 
			
		||||
 | 
			
		||||
    public ProcessQueryFactory() {}
 | 
			
		||||
 | 
			
		||||
    public ProcessQueryFactory(SigarProxy sigar) {
 | 
			
		||||
        this.sigar = sigar;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //sort what will become instruction branches.
 | 
			
		||||
    //so the cheapest are executed first.
 | 
			
		||||
    private int getOrder(String s) {
 | 
			
		||||
@ -127,13 +120,6 @@ public class ProcessQueryFactory implements Comparator {
 | 
			
		||||
        throws MalformedQueryException,
 | 
			
		||||
               QueryLoadException {
 | 
			
		||||
 | 
			
		||||
        return getInstance(query, null);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static ProcessQuery getInstance(String query, SigarProxy sigar)
 | 
			
		||||
        throws MalformedQueryException,
 | 
			
		||||
               QueryLoadException {
 | 
			
		||||
 | 
			
		||||
        if (query == null) {
 | 
			
		||||
            throw new MalformedQueryException("null query");
 | 
			
		||||
        }
 | 
			
		||||
@ -165,7 +151,7 @@ public class ProcessQueryFactory implements Comparator {
 | 
			
		||||
            queries.put(vals[0], vals[1]);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ProcessQueryFactory factory = new ProcessQueryFactory(sigar);
 | 
			
		||||
        ProcessQueryFactory factory = new ProcessQueryFactory();
 | 
			
		||||
 | 
			
		||||
        pQuery = factory.prepare(queries);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user