From 14677ee1b8d533a9607dfa79f336e364b5bb5804 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 23 Nov 2005 19:46:19 +0000 Subject: [PATCH] add pinfo command to view all proc fields --- .../src/net/hyperic/sigar/cmd/ProcInfo.java | 69 +++++++++++++++++++ .../java/src/net/hyperic/sigar/cmd/Shell.java | 1 + 2 files changed, 70 insertions(+) create mode 100644 bindings/java/src/net/hyperic/sigar/cmd/ProcInfo.java diff --git a/bindings/java/src/net/hyperic/sigar/cmd/ProcInfo.java b/bindings/java/src/net/hyperic/sigar/cmd/ProcInfo.java new file mode 100644 index 00000000..7888f371 --- /dev/null +++ b/bindings/java/src/net/hyperic/sigar/cmd/ProcInfo.java @@ -0,0 +1,69 @@ +package net.hyperic.sigar.cmd; + +import net.hyperic.sigar.SigarException; +import net.hyperic.sigar.SigarPermissionDeniedException; + +/** + * Display all process information. + */ +public class ProcInfo extends SigarCommandBase { + + public ProcInfo(Shell shell) { + super(shell); + } + + public ProcInfo() { + super(); + } + + protected boolean validateArgs(String[] args) { + return true; + } + + public String getUsageShort() { + return "Display all process info"; + } + + public boolean isPidCompleter() { + return true; + } + + public void output(String[] args) throws SigarException { + long[] pids = this.shell.findPids(args); + + for (int i=0; i