|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jgroup.experiment.ShellCommand
public final class ShellCommand
General class for executing shell commands.
Constructor Summary | |
---|---|
ShellCommand(java.lang.String cmd,
java.lang.ThreadGroup threadGroup)
Constructs a shell command object for the given cmd
string. |
|
ShellCommand(java.lang.String cmd,
java.lang.ThreadGroup threadGroup,
boolean suppressCmdOutput)
Constructs a shell command object for the given cmd
string. |
Method Summary | |
---|---|
static void |
exec(java.lang.String cmd)
Same as exec(commandString, null). |
static void |
exec(java.lang.String cmd,
java.lang.ThreadGroup threadGroup)
Takes a String and a ThreadGroup
as parameters, and executes the string as a shell command. |
boolean |
stderrModified()
|
boolean |
stdoutModified()
|
static void |
waitFor(java.lang.ThreadGroup threadGroup)
|
static void |
waitFor(java.lang.ThreadGroup threadGroup,
boolean debug)
This methods takes a ThreadGroup as a parameter,
and simply loops until all the threads in the ThreadGroup
have completed their tasks. |
boolean |
waitForProcess()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShellCommand(java.lang.String cmd, java.lang.ThreadGroup threadGroup)
cmd
string. If a thread group is provided, the command will be forked
in a separate thread.
command
- The command to be executed.threadGroup
- The ThreadGroup
the shell command will run in.
If null
, the command will run in the current thread.public ShellCommand(java.lang.String cmd, java.lang.ThreadGroup threadGroup, boolean suppressCmdOutput)
cmd
string. If a thread group is provided, the command will be forked
in a separate thread.
command
- The command to be executed.threadGroup
- The ThreadGroup
the shell command will run in.
If null
, the command will run in the current thread.suppressCmdOutput
- True will suppress command output.Method Detail |
---|
public boolean waitForProcess()
public boolean stdoutModified()
public boolean stderrModified()
public static void exec(java.lang.String cmd, java.lang.ThreadGroup threadGroup) throws java.io.IOException
String
and a ThreadGroup
as parameters, and executes the string as a shell command.
A new Thread
in the ThreadGroup
given as a parameter, unless the ThreadGroup
parameter is null
.
If the parameter is null
, the command is run in
the current thread.
command
- The command to be executed.threadGroup
- The ThreadGroup the shell command will run in.
If null
, the command will run in the current thread.
java.lang.Exception
java.io.IOException
public static void exec(java.lang.String cmd) throws java.io.IOException
command
-
java.lang.Exception
java.io.IOException
public static void waitFor(java.lang.ThreadGroup threadGroup, boolean debug)
ThreadGroup
as a parameter,
and simply loops until all the threads in the ThreadGroup
have completed their tasks.
threadGroup
- The ThreadGroup
that contain the threads
to wait for.public static void waitFor(java.lang.ThreadGroup threadGroup)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |