frysk.sys.proc
Class CmdLineBuilder

java.lang.Object
  extended by frysk.sys.proc.CmdLineBuilder

public abstract class CmdLineBuilder
extends Object

The build the command line argument list from the contents of the file /proc/PID/cmdline. While this isn't a pure builder pattern, it is close enough.


Constructor Summary
protected CmdLineBuilder()
          Create a CmdLineBuilder; can only extend.
 
Method Summary
abstract  void buildArgv(String[] argv)
          Build the argument vector corresponding to cmdline.
 boolean construct(byte[] cmdline)
          Scan the CMDLINE byte array building the corresponding command line string.
private  boolean construct(int pid)
           
 boolean construct(ProcessIdentifier pid)
          Scan the maps file found in /proc/PID/cmdline building up the command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmdLineBuilder

protected CmdLineBuilder()
Create a CmdLineBuilder; can only extend.

Method Detail

construct

public boolean construct(ProcessIdentifier pid)
Scan the maps file found in /proc/PID/cmdline building up the command line. Return true if the scan was successful.


construct

private final boolean construct(int pid)

construct

public final boolean construct(byte[] cmdline)
Scan the CMDLINE byte array building the corresponding command line string. It is assumed that the byte array contains ASCII characters, and for each entry includes a terminating NUL. buildArgv(java.lang.String[]) is called with the command line.


buildArgv

public abstract void buildArgv(String[] argv)
Build the argument vector corresponding to cmdline.