|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.icenigrid.gridsam.core.plugin.shell.AbstractShell
Abstract implementation of Shell
Nested Class Summary | |
protected class |
AbstractShell.PipeRunnable
a runnable that takes input from an ReadableByteChannel and write the input to the WritableByteChannel |
Field Summary | |
protected static int |
STDERR
id for standard error stream |
protected static int |
STDOUT
id for standard output stream |
Constructor Summary | |
AbstractShell()
|
Method Summary | |
int |
executeCommand(String pCommandString,
File pProcessRoot,
Properties pEnv)
execute a system process synchronously. |
int |
executeCommand(String pCommandString,
File pProcessRoot,
Properties pEnv,
CommandListener pListener)
execute a command synchronously. |
int |
executeCommand(String pCommandString,
File pProcessRoot,
Properties pEnv,
File pStdOut,
File pStdErr)
execute a command synchronously. |
Process |
executeCommandAsynchronously(String pCommandString,
File pProcessRoot,
Properties pEnv)
execute a system process asynchronously. |
protected Thread |
pipeStream(InputStream pInputStream,
int pStream,
CommandListener pListener)
pipe the input of a stream to the output |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.icenigrid.gridsam.core.plugin.shell.Shell |
close, executeCommand, executeCommandAsynchronously, executeCommandAsynchronously, executeCommandAsynchronously, getFileSystem |
Field Detail |
protected static final int STDOUT
protected static final int STDERR
Constructor Detail |
public AbstractShell()
Method Detail |
public Process executeCommandAsynchronously(String pCommandString, File pProcessRoot, Properties pEnv) throws IOException
executeCommandAsynchronously
in interface Shell
pCommandString
- the command string
IOException
public int executeCommand(String pCommandString, File pProcessRoot, Properties pEnv) throws InterruptedException, IOException
executeCommand
in interface Shell
pCommandString
- the command stringpProcessRoot
- the root directory where the process will be executed. Can be null if this parameter is not
usedpEnv
- the environment
InterruptedException
- if the command is interrupted
IOException
- if the command cannot be executedpublic int executeCommand(String pCommandString, File pProcessRoot, Properties pEnv, File pStdOut, File pStdErr) throws InterruptedException, IOException
executeCommand
in interface Shell
pCommandString
- the command stringpProcessRoot
- the root directory where the process will be executed. Can be null if this parameter is not
usedpStdOut
- File to write the standard output topStdErr
- File to write the standard error to
InterruptedException
- if the command is interrupted
IOException
- if the command cannot be executedprotected Thread pipeStream(InputStream pInputStream, int pStream, CommandListener pListener) throws IOException
pInputStream
- input streampStream
- the stream identifier STDOUT | STDERRpListener
- the listener to receive data
IOException
public int executeCommand(String pCommandString, File pProcessRoot, Properties pEnv, CommandListener pListener) throws InterruptedException, IOException
executeCommand
in interface Shell
pCommandString
- the command stringpProcessRoot
- the root directory where the process will be executed. Can be null if this parameter is not
usedpListener
- CommandListener that receives process output and error stream data
InterruptedException
- if the command is interrupted
IOException
- if the command cannot be executed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |