diff --git a/bindings/java/src/net/hyperic/sigar/CurrentProcessSummary.java b/bindings/java/src/net/hyperic/sigar/CurrentProcessSummary.java index deebd448..711a4417 100644 --- a/bindings/java/src/net/hyperic/sigar/CurrentProcessSummary.java +++ b/bindings/java/src/net/hyperic/sigar/CurrentProcessSummary.java @@ -1,5 +1,9 @@ package net.hyperic.sigar; +/** + * This class provides a summary of current process states. + * @see net.hyperic.sigar.cmd.Top + */ public class CurrentProcessSummary { private int total=0, sleeping=0, running=0, zombie=0, stopped=0; diff --git a/bindings/java/src/net/hyperic/sigar/Sigar.java b/bindings/java/src/net/hyperic/sigar/Sigar.java index 63e5a5f9..d9f70e1f 100644 --- a/bindings/java/src/net/hyperic/sigar/Sigar.java +++ b/bindings/java/src/net/hyperic/sigar/Sigar.java @@ -11,13 +11,22 @@ import net.hyperic.jni.ArchLoaderException; import net.hyperic.jni.ArchNotSupportedException; /** - * Entry point for the Sigar - System Information GAtheRer + * The Sigar class provides access to the sigar objects containing + * system information. The Sigar object itself maintains internal + * state specific to each platform. It also implements the SigarProxy + * interface which provides caching at the Java level. */ public class Sigar implements SigarProxy { + /** + * The Sigar version in String form. + */ public static final String VERSION_STRING = SigarVersion.VERSION_STRING; + /** + * The date on which the Sigar binaries were built. + */ public static final String BUILD_DATE = SigarVersion.BUILD_DATE; @@ -67,7 +76,7 @@ public class Sigar implements SigarProxy { public static native String formatSize(long size); /** - * Constructor + * Allocate and initialize the native Sigar object. */ public Sigar() { try { @@ -99,6 +108,8 @@ public class Sigar implements SigarProxy { /** * Release any native resources associated with this sigar instance. * The sigar object is no longer usable after it has been closed. + * If the close method is not called directly, the finalize method will + * call it if the Sigar object is garbage collected. */ public void close() { if (this.sigarWrapper != 0) { @@ -115,7 +126,7 @@ public class Sigar implements SigarProxy { public native long getPid(); /** - * Send signal to a process. + * Send a signal to a process. * * @param pid The process id. * @param signum The signal number. @@ -395,7 +406,8 @@ public class Sigar implements SigarProxy { } /** - * Get process loaded modules. + * Get process loaded modules.
+ * Supported Platforms: Linux, Solaris and Windows. * @param pid The process id. * @return List of loaded modules. * @exception SigarException on failure. @@ -410,6 +422,13 @@ public class Sigar implements SigarProxy { return getProcModules(convertPid(pid)); } + /** + * Find the pid of the process which is listening on the given port.
+ * Supported Platforms: Linux and Windows XP only. + * @param port The port number. + * @return pid of the process. + * @exception SigarException on failure. + */ public native long getProcPort(long port) throws SigarException; public long getProcPort(String port) throws SigarException { @@ -580,6 +599,13 @@ public class Sigar implements SigarProxy { */ public native String getFQDN() throws SigarException; + /** + * Enabling logging in the native Sigar code. + * This method will hook log4j into the Sigar + * native logging methods. Note that the majority + * of logging in the native code is only at the DEBUG + * level. + */ public void enableLogging(boolean value) { if (value) { SigarLog.enable(this); diff --git a/bindings/java/src/net/hyperic/sigar/SigarInvoker.java b/bindings/java/src/net/hyperic/sigar/SigarInvoker.java index 09ee5658..e4ba0f37 100644 --- a/bindings/java/src/net/hyperic/sigar/SigarInvoker.java +++ b/bindings/java/src/net/hyperic/sigar/SigarInvoker.java @@ -8,7 +8,7 @@ import java.lang.reflect.Method; /** * This class provides a string-ish interface to sigar. - * It is intended for use via JMX and Covalent CAM measurement + * It is intended for use via JMX and Hyperic HQ measurement * plugins. Method lookups are cached and the like for better * performance. */ diff --git a/bindings/java/src/net/hyperic/sigar/SigarProxyCache.java b/bindings/java/src/net/hyperic/sigar/SigarProxyCache.java index 1ef3ab57..2e6a2cfd 100644 --- a/bindings/java/src/net/hyperic/sigar/SigarProxyCache.java +++ b/bindings/java/src/net/hyperic/sigar/SigarProxyCache.java @@ -9,6 +9,11 @@ import java.lang.reflect.Method; import net.hyperic.sigar.util.ReferenceMap; +/** + * This class implements a caching mechanism to avoid system calls + * with heavy Sigar usage in a short period of time. It is intended + * for use in applications such as Top. + */ public class SigarProxyCache implements InvocationHandler { diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Shell.java b/bindings/java/src/net/hyperic/sigar/cmd/Shell.java index 67aec3ff..3acaa7c8 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Shell.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Shell.java @@ -21,6 +21,10 @@ import net.hyperic.sigar.shell.ShellCommandUsageException; import net.hyperic.sigar.test.SigarTestRunner; +/** + * The Sigar Shell provides a command shell for running the example + * commands and Sigar tests. + */ public class Shell extends ShellBase { public static final String RCFILE_NAME = ".sigar_shellrc"; @@ -64,6 +68,8 @@ public class Shell extends ShellBase { try { //requires junit.jar registerCommandHandler("test", new SigarTestRunner(this)); + } catch (NoClassDefFoundError e) { } + try { //requires bcel-5.1.jar registerCommandHandler("ptql", new PTQL(this)); } catch (NoClassDefFoundError e) { } diff --git a/bindings/java/src/net/hyperic/sigar/util/Getline.java b/bindings/java/src/net/hyperic/sigar/util/Getline.java index b48295be..414fd3dd 100644 --- a/bindings/java/src/net/hyperic/sigar/util/Getline.java +++ b/bindings/java/src/net/hyperic/sigar/util/Getline.java @@ -4,6 +4,13 @@ import java.io.IOException; import java.io.EOFException; import java.io.File; +/** + * This class provides Emacs style key bindings, history and tab completion + * for command shell applications. + * + * This class is a Java interface to the getline.c package: + * Copyright (C) 1991, 1992 by Chris Thewalt (thewalt@ce.berkeley.edu) + */ public class Getline { private String prompt = "> "; diff --git a/bindings/java/src/net/hyperic/sigar/util/PrintfFormat.java b/bindings/java/src/net/hyperic/sigar/util/PrintfFormat.java index 9d849ae9..a6f12540 100644 --- a/bindings/java/src/net/hyperic/sigar/util/PrintfFormat.java +++ b/bindings/java/src/net/hyperic/sigar/util/PrintfFormat.java @@ -427,7 +427,7 @@ import java.text.DecimalFormatSymbols; *
* Most of this specification is quoted from the Unix * man page for the sprintf utility.
- * + * (c) 2000 Sun Microsystems, Inc. * @author Allan Jacobs * @version 1 * Release 1: Initial release.