org.apache.cxf.common.commands
Class ForkedCommand
java.lang.Object
java.lang.Thread
org.apache.cxf.common.commands.ForkedCommand
- All Implemented Interfaces:
- Runnable
- Direct Known Subclasses:
- ResultBufferedCommand
public class ForkedCommand
- extends Thread
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, yield |
EXE_SUFFIX
public static final String EXE_SUFFIX
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT
- See Also:
- Constant Field Values
ForkedCommand
public ForkedCommand()
ForkedCommand
public ForkedCommand(String[] args)
setArgs
protected void setArgs(String[] args)
setEnvironment
public void setEnvironment(String[] env)
toString
public String toString()
- Overrides:
toString
in class Thread
joinErrOut
public void joinErrOut(boolean flag)
- Determines if the threads collecting the forked process' stdout/stderr
should be joined.
- Parameters:
flag
- boolean indicating if threads should be joined
execute
public int execute()
execute
public int execute(int timeout)
- Executes the process. If the process has not completed after the
specified amount of seconds, it is killed.
- Parameters:
timeout
- the timeout in seconds
- Throws:
ForkedCommandException
- if process execution fails for some reason
or if the timeout has expired and the process was killed
run
public void run()
- Implements the run method for the thread on which the process is
executed.
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
setOutputStream
public void setOutputStream(PrintStream os)
setErrorStream
public void setErrorStream(PrintStream es)
Apache CXF