@Override public String toString() { StringBuilder s = new StringBuilder("process: "); s.append("pid=["); s.append(getPid()); s.append("], name=["); s.append((!getName().equals(UNKNOWN_PROCESS_NAME)) ? getName() : getBaseName()); s.append("], ppid=["); try { s.append(priorSnaphot().getParentPid()); } catch (Exception e) { s.append(e); } s.append("]"); return s.toString(); }
@Override public String toString() { StringBuilder s = new StringBuilder("process: "); s.append("pid=["); s.append(getPid()); s.append("], name=["); s.append((!getName().equals(UNKNOWN_PROCESS_NAME)) ? getName() : getBaseName()); s.append("], ppid=["); try { s.append(priorSnaphot().getParentPid()); } catch (Exception e) { s.append(e); } s.append("]"); return s.toString(); }
/** * @deprecated as of 4.6. For similar purpose, call {@link #priorSnaphot()} and then corresponding method * from the returned {@link ProcessInfoSnapshot}. */ @Deprecated public long getParentPid() throws SystemInfoException { return priorSnaphot().getParentPid(); }
/** * Returns a {@link ProcessInfo} instance for the parent of this process. * * This method uses the parent process id which is not static (it can change if the parent process dies before its * child). So in theory it should be moved to the {@link ProcessInfoSnapshot} type. * * In practice, it stays here because the parent {@link ProcessInfo} instance is cached after creation. * * @since 4.4 */ public ProcessInfo getParentProcess() throws SystemInfoException { if (this.parentProcess == null) { this.parentProcess = new ProcessInfo(priorSnaphot().getParentPid(), sigar); } else { this.parentProcess.refresh(); } return this.parentProcess; }
/** * Returns a {@link ProcessInfo} instance for the parent of this process. * * This method uses the parent process id which is not static (it can change if the parent process dies before its * child). So in theory it should be moved to the {@link ProcessInfoSnapshot} type. * * In practice, it stays here because the parent {@link ProcessInfo} instance is cached after creation. * * @since 4.4 */ public ProcessInfo getParentProcess() throws SystemInfoException { if (this.parentProcess == null) { this.parentProcess = new ProcessInfo(priorSnaphot().getParentPid(), sigar); } else { this.parentProcess.refresh(); } return this.parentProcess; }
/** * @deprecated as of 4.6. For similar purpose, call {@link #priorSnaphot()} and then corresponding method * from the returned {@link ProcessInfoSnapshot}. */ @Deprecated public long getParentPid() throws SystemInfoException { return priorSnaphot().getParentPid(); }