org.hyperic.sigar.ProcExe Maven / Gradle / Ivy
/*****************************************************
* WARNING: this file was generated by -e
* on Mon May 24 16:26:06 2010.
* Any changes made here will be LOST.
*****************************************************/
package org.hyperic.sigar;
import java.util.HashMap;
import java.util.Map;
/**
* ProcExe sigar class.
*/
public class ProcExe implements java.io.Serializable {
private static final long serialVersionUID = 1997L;
public ProcExe() { }
public native void gather(Sigar sigar, long pid) throws SigarException;
/**
* This method is not intended to be called directly.
* use Sigar.getProcExe() instead.
* @exception SigarException on failure.
* @see org.hyperic.sigar.Sigar#getProcExe
*/
static ProcExe fetch(Sigar sigar, long pid) throws SigarException {
ProcExe procExe = new ProcExe();
procExe.gather(sigar, pid);
return procExe;
}
String name = null;
/**
* Get the Name of process executable.
* Supported Platforms: FreeBSD, Linux, Solaris, Win32.
*
* System equivalent commands:
* - AIX:
* - Darwin:
* - FreeBSD:
* - HPUX:
* - Linux:
ls -l /proc/$$/exe
* - Solaris:
* - Win32:
*
* @return Name of process executable
*/
public String getName() { return name; }
String cwd = null;
/**
* Get the Name of process current working directory.
* Supported Platforms: Linux, Solaris, Win32.
*
* System equivalent commands:
* - AIX:
* - Darwin:
* - FreeBSD:
* - HPUX:
* - Linux:
ls -l /proc/$$/cwd
* - Solaris:
* - Win32:
*
* @return Name of process current working directory
*/
public String getCwd() { return cwd; }
void copyTo(ProcExe copy) {
copy.name = this.name;
copy.cwd = this.cwd;
}
public Map toMap() {
Map map = new HashMap();
String strname =
String.valueOf(this.name);
if (!"-1".equals(strname))
map.put("Name", strname);
String strcwd =
String.valueOf(this.cwd);
if (!"-1".equals(strcwd))
map.put("Cwd", strcwd);
return map;
}
public String toString() {
return toMap().toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy