Package org.hyperic.sigar.ptql

Examples of org.hyperic.sigar.ptql.ProcessFinder


        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);
        }
    }
View Full Code Here


        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);
        }
    }
View Full Code Here

        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);
        }
    }
View Full Code Here

        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);
        }
    }
View Full Code Here

        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);
        }
    }
View Full Code Here

        try {
            if (sigar == null) {
                sigar = org.sleuthkit.autopsy.corelibs.SigarLoader.getSigar();
            }
            if (sigar != null) {
                ProcessFinder finder = new ProcessFinder(sigar);
                jpid = finder.findSingleProcess(sigarQuery);
            } else {
                System.out.println(NbBundle.getMessage(PlatformUtil.class, "PlatformUtil.getJavaPID.sigarNotInit.msg"));
            }
        } catch (Exception e) {
            System.out.println(
View Full Code Here

        try {
            if (sigar == null) {
                sigar = org.sleuthkit.autopsy.corelibs.SigarLoader.getSigar();
            }
            if (sigar != null) {
                ProcessFinder finder = new ProcessFinder(sigar);
                jpids = finder.find(sigarQuery);
            } else {
                System.out.println(NbBundle.getMessage(PlatformUtil.class, "PlatformUtil.getJavaPIDs.sigarNotInit"));
            }
        } catch (Exception e) {
            System.out.println(
View Full Code Here

  }

  private long getPid(String processName) throws SigarException {
    long pid;

    ProcessFinder processFinder = new ProcessFinder(sigarImpl);
    String query;

    if (processName.equals("$$")) {
      pid = sigar.getPid();
      logger.debug("Return own pid {}", pid);
      return pid;
    } else if (processName.startsWith("*")) {
      query = "State.Name.sw=" + processName.replace("*", "");
    } else if (processName.endsWith("*")) {
      query = "State.Name.ew=" + processName.replace("*", "");
    } else if (processName.startsWith("=")) {
      query = "State.Name.eq=" + processName.replace("=", "");
    } else if (processName.startsWith("#")) {
      query = processName.replace("#", "");
    } else {
      query = "State.Name.ct=" + processName;
    }

    logger.debug("Query pid by '{}'", query);
    pid = processFinder.findSingleProcess(query);

    logger.debug("Return pid {}", pid);
    return pid;
  }
View Full Code Here

TOP

Related Classes of org.hyperic.sigar.ptql.ProcessFinder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.