org.ourgrid.common.executor
Class AbstractExecutor

java.lang.Object
  extended by org.ourgrid.common.executor.AbstractExecutor
All Implemented Interfaces:
java.io.Serializable, Executor
Direct Known Subclasses:
LinuxExecutor, Win32Executor

public abstract class AbstractExecutor
extends java.lang.Object
implements Executor

This class define an abstraction for the operating system dependent part of executing commands. The concrete implementors of this class must provide the correct behavior for executing a command, killing a process and changing the permissions of files.

See Also:
Serialized Form

Constructor Summary
AbstractExecutor()
           
 
Method Summary
protected  ExecutorResult catchOutput(java.lang.Process process)
          Creates and returns a instance of ExcecutorResult that will contain the informations about the finished process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ourgrid.common.executor.Executor
chmod, execute, execute, getResult, kill
 

Constructor Detail

AbstractExecutor

public AbstractExecutor()
Method Detail

catchOutput

protected ExecutorResult catchOutput(java.lang.Process process)
                              throws java.lang.InterruptedException
Creates and returns a instance of ExcecutorResult that will contain the informations about the finished process.

Parameters:
process - The process that is supposed to be finished and the streams must be caught and the exit value recovered.
Returns:
An instance of ExecutorResult describing the result of process execution.
Throws:
java.lang.InterruptedException - If the thread that is catching the result is interrupted.