juju.reattore.perfcap.var.impl
Class CommandLineVar

java.lang.Object
  |
  +--juju.reattore.perfcap.var.impl.CommandLineVar
All Implemented Interfaces:
Variable

public class CommandLineVar
extends java.lang.Object
implements Variable

A 'Variable' that actually starts a background process.


Constructor Summary
CommandLineVar()
           
 
Method Summary
 void begin()
          Initialises and resets this variable.
 void end()
          Called when done with this variable.
 java.lang.String getName()
          The name of this variable.
 java.lang.Object getValue()
          The current value of this variable.
 boolean hasNext()
          Returns true if there are more values in this sequence.
 void next()
          Advances to the next value.
 void setDir(java.lang.String dir)
          The working directory to run from.
 void setName(java.lang.String name)
          The name to identify this process as.
 void setShutdownCmd(java.lang.String cmd)
          The Runtime.exec command to run to stop the process.
 void setStartDelay(int delay)
          The time in ms to wait for the process to start.
 void setStartupCmd(java.lang.String cmd)
          The Runtime.exec command to run to start the process.
 void setWaitFor(java.lang.String waitFor)
          The regex string that signifies that the process has started.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineVar

public CommandLineVar()
Method Detail

setDir

public void setDir(java.lang.String dir)
The working directory to run from.

Parameters:
dir - Working dir.

setStartupCmd

public void setStartupCmd(java.lang.String cmd)
The Runtime.exec command to run to start the process.

Parameters:
cmd - The command.

setShutdownCmd

public void setShutdownCmd(java.lang.String cmd)
The Runtime.exec command to run to stop the process. If not set, defaults to killing the process.

Parameters:
cmd - The command.

setWaitFor

public void setWaitFor(java.lang.String waitFor)
The regex string that signifies that the process has started.

Parameters:
waitFor - The Matcher.match regex.

setStartDelay

public void setStartDelay(int delay)
The time in ms to wait for the process to start.

Parameters:
delay - Time in ms.

setName

public void setName(java.lang.String name)
The name to identify this process as. Also returned as the value.

Parameters:
name - The name.

getName

public java.lang.String getName()
Description copied from interface: Variable
The name of this variable.

Specified by:
getName in interface Variable
Returns:
The name.
See Also:
Variable

getValue

public java.lang.Object getValue()
Description copied from interface: Variable
The current value of this variable. May be called many times.

Specified by:
getValue in interface Variable
Returns:
The current value.
See Also:
Variable

hasNext

public boolean hasNext()
Description copied from interface: Variable
Returns true if there are more values in this sequence.

Specified by:
hasNext in interface Variable
Returns:
true if more are available.
See Also:
Variable

next

public void next()
Description copied from interface: Variable
Advances to the next value. #getValue is not valid until this is called.

Specified by:
next in interface Variable
See Also:
Variable

begin

public void begin()
           throws java.lang.Exception
Description copied from interface: Variable
Initialises and resets this variable.

Specified by:
begin in interface Variable
Throws:
java.lang.Exception - on error.
See Also:
Variable

end

public void end()
         throws java.lang.Exception
Description copied from interface: Variable
Called when done with this variable.

Specified by:
end in interface Variable
Throws:
java.lang.Exception - on error.
See Also:
Variable


Copyright © 2002-2003 Michael Hope. All Rights Reserved.