abbot.script
Class ForkedStepRunner

java.lang.Object
  |
  +--abbot.script.StepRunner
        |
        +--abbot.script.ForkedStepRunner

public class ForkedStepRunner
extends StepRunner

A StepRunner that runs the step in a separate VM. Behavior should be indistinguishable from the base StepRunner.


Inner Class Summary
(package private)  class ForkedStepRunner.ForkedError
          An exception that for all purposes looks like another exception.
(package private)  class ForkedStepRunner.ForkedFailure
          An exception that for all purposes looks like another exception.
protected static class ForkedStepRunner.SlaveStepRunner
          When actually within the separate VM, this is what gets run.
 
Field Summary
(package private)  int LAUNCH_TIMEOUT
           
(package private)  int TERMINATE_TIMEOUT
           
 
Constructor Summary
ForkedStepRunner()
           
 
Method Summary
(package private) static Step decodeStep(Sequence root, String code)
           
(package private) static String encodeStep(Sequence root, Step step)
          Encode the given step into a set of indices.
(package private)  Process fork(String vmargs)
          Launch a new process, using this class as the main class.
(package private)  Process fork(String vmargs, String[] cmdArgs)
           
static void main(String[] args)
          Provide means to control execution and feedback of a script in a separate process.
 void runStep(Step step)
          Running the step in a separate VM should be indistinguishable from running a regular script.
 
Methods inherited from class abbot.script.StepRunner
addStepListener, clearErrors, fireStepEnd, fireStepError, fireStepEvent, fireStepFailure, fireStepProgress, fireStepStart, getError, getStopOnError, getStopOnFailure, launch, removeStepListener, run, setError, setStopOnError, setStopOnFailure, setTerminateOnError, setUp, stop, stop, stopped, tearDown, terminate
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAUNCH_TIMEOUT

int LAUNCH_TIMEOUT

TERMINATE_TIMEOUT

int TERMINATE_TIMEOUT
Constructor Detail

ForkedStepRunner

public ForkedStepRunner()
Method Detail

fork

Process fork(String vmargs,
             String[] cmdArgs)
       throws IOException

fork

Process fork(String vmargs)
       throws UnknownHostException,
              IOException
Launch a new process, using this class as the main class.

runStep

public void runStep(Step step)
             throws Throwable
Running the step in a separate VM should be indistinguishable from running a regular script. When running as master, nothing actually runs locally. We just fork a subprocess and run the script in that, reporting back its progress as if it were running locally.
Overrides:
runStep in class StepRunner

decodeStep

static Step decodeStep(Sequence root,
                       String code)

encodeStep

static String encodeStep(Sequence root,
                         Step step)
Encode the given step into a set of indices.

main

public static void main(String[] args)
Provide means to control execution and feedback of a script in a separate process.


Copyright © 2002-2003 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge