|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.nmu.os.shell.Command | +--edu.nmu.os.shell.CommandImpl
Encapsulates the functionality of a single shell command
Constructor Summary | |
CommandImpl(java.lang.String string,
java.io.InputStream in,
java.io.PrintStream out,
java.io.PrintStream err,
java.lang.String[] args,
java.lang.String program,
boolean fork,
boolean exit,
boolean force)
Constructs a new CommandImpl |
Method Summary | |
boolean |
forceCurrentThread()
Determines whether the Command should be run in the same Thread as the executor |
boolean |
fork()
Determines whether this Command should be joined with immediately after its execution |
java.lang.String[] |
getArgs()
Gets the parameters that will be given to the program when this Command is executed |
java.io.PrintStream |
getErr()
Gets the PrintStream that should be used as NewSystem.err during execution |
java.io.InputStream |
getIn()
Gets the InputStream that should be used as NewSystem.in during execution |
java.io.PrintStream |
getOut()
Gets the PrintStream that should be used as NewSystem.out during execution |
java.lang.String |
getProgram()
Gets the name of the program that will be run when this Command is executed |
boolean |
isExit()
Determines whether or not this Command is a command to exit the Shell |
protected java.lang.Class |
resolveClass(java.lang.String program)
Resolves the given program as a Class |
protected java.io.File |
resolveExecutable(java.lang.String program)
Resolves the given program as a File |
java.lang.String |
toString()
Returns the string specified in the constructor |
Methods inherited from class edu.nmu.os.shell.Command |
isResolved, run |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CommandImpl(java.lang.String string, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err, java.lang.String[] args, java.lang.String program, boolean fork, boolean exit, boolean force)
string
- to be returned by toString()
in
- to be returned by getIn()
out
- to be returned by getOut()
err
- to be returned by getErr()
args
- to be returned by getArgs()
program
- to be returned by getProgram()
fork
- to be returned by fork()
exit
- to be returned by isExit()
force
- to be returned by forceCurrentThread()
Method Detail |
public java.lang.String getProgram()
Command
getProgram
in class Command
public java.lang.String[] getArgs()
Command
getArgs
in class Command
public boolean fork()
Command
fork
in class Command
public java.io.InputStream getIn()
Command
getIn
in class Command
public java.io.PrintStream getOut()
Command
getOut
in class Command
public java.io.PrintStream getErr()
Command
getErr
in class Command
public boolean isExit()
Command
isExit
in class Command
public boolean forceCurrentThread()
Command
forceCurrentThread
in class Command
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.Class resolveClass(java.lang.String program) throws java.lang.ClassNotFoundException
Tries to resolve the Class to classes in the current Shell's classpath path if the default implementation is not sufficient
resolveClass
in class Command
program
- the name of the program to be resolved
java.lang.ClassNotFoundException
- if resolution was unsuccessfulprotected java.io.File resolveExecutable(java.lang.String program) throws java.io.FileNotFoundException
Tries to resolve the File to files in the current Shell's path
resolveExecutable
in class Command
program
- the name of the program to be resolved
java.io.FileNotFoundException
- if resolution was unsuccessful
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |