org.syrup.functions
Class Shell

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.syrup.functions.Shell
All Implemented Interfaces:
Function, java.lang.Runnable

public class Shell
extends java.lang.Thread
implements Function

Executes a shell command provided by the first input. The second (optional) input provides the stdin. The first output connects to stdout and the second output to stderr. If the second input is not given the first (command) input is consumed. The second input is always consumed.

Author:
Robbert van Dalen

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Shell()
           
 
Method Summary
 Result execute(Context context)
          Generates a Result given a Task's Context.
 void run()
          Executed when the JVM is in shutdown.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Shell

public Shell()
Method Detail

execute

public Result execute(Context context)
Description copied from interface: Function
Generates a Result given a Task's Context. Implementations should not throw Exceptions, retain Objects or any other resources after the calling Thread exits this method.

Specified by:
execute in interface Function
Parameters:
context - The Context from which the Function get its parameters.
Returns:
The Result after execution.

run

public void run()
Executed when the JVM is in shutdown.

Specified by:
run in interface java.lang.Runnable