add getProcModules

This commit is contained in:
Doug MacEachern 2004-06-22 06:14:12 +00:00
parent efed7c955f
commit d034a2a16e
3 changed files with 35 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import java.util.Map;
import net.hyperic.jni.ArchLoaderException;
@ -382,6 +383,22 @@ public class Sigar implements SigarProxy {
return getProcEnv(convertPid(pid), key);
}
/**
* Get process loaded modules.
* @param pid The process id.
* @return List of loaded modules.
* @exception SigarException on failure.
*/
private native List getProcModulesNative(long pid) throws SigarException;
public List getProcModules(long pid) throws SigarException {
return getProcModulesNative(pid);
}
public List getProcModules(String pid) throws SigarException {
return getProcModules(convertPid(pid));
}
public native long getProcPort(long port) throws SigarException;
public long getProcPort(String port) throws SigarException {

View File

@ -1,5 +1,6 @@
package net.hyperic.sigar;
import java.util.List;
import java.util.Map;
/**
@ -72,6 +73,10 @@ public interface SigarProxy {
public String getProcEnv(String pid, String key) throws SigarException;
public List getProcModules(long pid) throws SigarException;
public List getProcModules(String pid) throws SigarException;
public long getProcPort(long port) throws SigarException;
public long getProcPort(String port) throws SigarException;

View File

@ -1,5 +1,6 @@
package net.hyperic.sigar;
import java.util.List;
import java.util.Map;
/**
@ -202,6 +203,18 @@ public class SynchronizedSigar implements SigarProxy {
return this.sigar.getProcEnv(pid, key);
}
public synchronized List getProcModules(long pid)
throws SigarException
{
return this.sigar.getProcModules(pid);
}
public synchronized List getProcModules(String pid)
throws SigarException
{
return this.sigar.getProcModules(pid);
}
public synchronized long getProcPort(long port)
throws SigarException
{