Rio Project 4.2 API Documentation



org.rioproject.exec.support
Class PosixProcessManager

java.lang.Object
  extended by org.rioproject.exec.ProcessManager
      extended by org.rioproject.exec.support.PosixProcessManager

public class PosixProcessManager
extends ProcessManager

A ProcessManager implementation for posix compliant systems

Author:
Dennis Reedy

Nested Class Summary
 
Nested classes/interfaces inherited from class org.rioproject.exec.ProcessManager
ProcessManager.Listener
 
Constructor Summary
PosixProcessManager(Process process, int pid, String stdOutFileName, String stdErrFileName)
          Create a PosixProcessManager
 
Method Summary
 void destroy(boolean includeChildren)
          Destroy the managed process
 void manage()
          Manage the Process
 void setCommandFile(File commandFile)
          Set the generated command file to delete
 void setCommandLine(String commandLine)
          Set the command line that was executed
 void waitFor()
          Waits for the process to exit
 
Methods inherited from class org.rioproject.exec.ProcessManager
getPid, getProcess, notifyOnTermination, registerListener, unregisterListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PosixProcessManager

public PosixProcessManager(Process process,
                           int pid,
                           String stdOutFileName,
                           String stdErrFileName)
Create a PosixProcessManager

Parameters:
process - The Process the ProcessManager will manage
pid - The process ID of the started Process
stdOutFileName - The file name to redirect standard output to
stdErrFileName - The file name to redirect standard error to
Method Detail

setCommandFile

public void setCommandFile(File commandFile)
Set the generated command file to delete

Parameters:
commandFile - The script that started the process this process manager is managing. Upon exit, delete this file

setCommandLine

public void setCommandLine(String commandLine)
Set the command line that was executed

Parameters:
commandLine - The command line that was executed, and as a result of it's execution this manager created. If set, this will be useful for logging purposes.

manage

public void manage()
            throws IOException
Manage the Process

Specified by:
manage in class ProcessManager
Throws:
IOException - if the process management utility cannot be created

destroy

public void destroy(boolean includeChildren)
Destroy the managed process

Specified by:
destroy in class ProcessManager
Parameters:
includeChildren - If true, destroy all child processes as well. This method will look for all child processes that have a parent process ID of the managed process and forcibly terminate them.

waitFor

public void waitFor()
Waits for the process to exit

Specified by:
waitFor in class ProcessManager

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.