SmartFrog 3.10.000

org.smartfrog.services.shellscript
Class RunProcessImpl

java.lang.Object
  extended by java.lang.Thread
      extended by org.smartfrog.services.shellscript.RunProcessImpl
All Implemented Interfaces:
java.lang.Runnable, RunProcess

public class RunProcessImpl
extends java.lang.Thread
implements RunProcess


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected static java.text.DateFormat dateFormatter
          Used to format times
static int STATE_INACTIVE
           
static int STATE_PROCESSING
           
static int STATE_STARTED
           
static int STATE_STARTING
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RunProcessImpl(java.lang.String name, Cmd cmd)
           
RunProcessImpl(java.lang.String name, Cmd cmd, Prim prim)
           
 
Method Summary
 void execCommand(java.lang.String command)
          Executes the given command.
 FilterImpl getErrFilter()
           
 java.io.InputStream getErrorStream()
          Gets the error stream of the subprocess.
 java.io.InputStream getInputStream()
          Gets the input stream of the subprocess.
 FilterImpl getOutFilter()
           
 java.io.OutputStream getOutputStream()
          Gets the output stream of the subprocess.
 int getProcessState()
           
 void kill()
           
 boolean ready()
           
 void replaceFilters(FilterImpl fout, FilterImpl ferr)
           
 void run()
           
 void waitForReady(long time)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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
 

Field Detail

dateFormatter

protected static java.text.DateFormat dateFormatter
Used to format times


STATE_INACTIVE

public static final int STATE_INACTIVE
See Also:
Constant Field Values

STATE_STARTING

public static final int STATE_STARTING
See Also:
Constant Field Values

STATE_STARTED

public static final int STATE_STARTED
See Also:
Constant Field Values

STATE_PROCESSING

public static final int STATE_PROCESSING
See Also:
Constant Field Values
Constructor Detail

RunProcessImpl

public RunProcessImpl(java.lang.String name,
                      Cmd cmd,
                      Prim prim)

RunProcessImpl

public RunProcessImpl(java.lang.String name,
                      Cmd cmd)
Method Detail

getProcessState

public int getProcessState()
Specified by:
getProcessState in interface RunProcess

ready

public boolean ready()
Specified by:
ready in interface RunProcess

waitForReady

public void waitForReady(long time)
Specified by:
waitForReady in interface RunProcess

run

public void run()
Specified by:
run in interface java.lang.Runnable
Specified by:
run in interface RunProcess
Overrides:
run in class java.lang.Thread

replaceFilters

public void replaceFilters(FilterImpl fout,
                           FilterImpl ferr)

getOutFilter

public FilterImpl getOutFilter()

getErrFilter

public FilterImpl getErrFilter()

kill

public void kill()
Specified by:
kill in interface RunProcess

execCommand

public void execCommand(java.lang.String command)
Executes the given command.

Specified by:
execCommand in interface RunProcess
Parameters:
command - command to be exceuted

getInputStream

public java.io.InputStream getInputStream()
Gets the input stream of the subprocess. The stream obtains data piped from the standard output stream of the process (Process) object.

Implementation note: It is a good idea for the input stream to be buffered.

Specified by:
getInputStream in interface RunProcess
Returns:
the input stream connected to the normal output of the subprocess.

getErrorStream

public java.io.InputStream getErrorStream()
Gets the error stream of the subprocess. The stream obtains data piped from the error output stream of the process (Process) object.

Implementation note: It is a good idea for the input stream to be buffered.

Specified by:
getErrorStream in interface RunProcess
Returns:
the input stream connected to the error stream of the subprocess.

getOutputStream

public java.io.OutputStream getOutputStream()
Gets the output stream of the subprocess. Output to the stream is piped into the standard input stream of the process (Process) object.

Implementation note: It is a good idea for the output stream to be buffered.

Specified by:
getOutputStream in interface RunProcess
Returns:
the output stream connected to the normal input of the subprocess.

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP