org.artofsolving.jodconverter.process
Class LinuxProcessManager

java.lang.Object
  extended by org.artofsolving.jodconverter.process.LinuxProcessManager
All Implemented Interfaces:
ProcessManager

public class LinuxProcessManager
extends Object
implements ProcessManager

ProcessManager implementation for Linux. Uses the ps and kill commands.

Should Work on Solaris too, except that the command line string returned by ps there is limited to 80 characters and this affects #findPid(String).


Field Summary
 
Fields inherited from interface org.artofsolving.jodconverter.process.ProcessManager
PID_UNKNOWN
 
Constructor Summary
LinuxProcessManager()
           
 
Method Summary
 long findPid(ProcessQuery query)
           
 void kill(Process process, long pid)
           
protected  String[] psCommand()
           
 void setRunAsArgs(String... runAsArgs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinuxProcessManager

public LinuxProcessManager()
Method Detail

setRunAsArgs

public void setRunAsArgs(String... runAsArgs)

psCommand

protected String[] psCommand()

findPid

public long findPid(ProcessQuery query)
             throws IOException
Specified by:
findPid in interface ProcessManager
Returns:
the pid or ProcessManager.PID_UNKNOWN
Throws:
IOException

kill

public void kill(Process process,
                 long pid)
          throws IOException
Specified by:
kill in interface ProcessManager
Throws:
IOException


Copyright © 2003-2011. All Rights Reserved.