abbot.script
Class ForkedStepRunner

java.lang.Object
  extended by abbot.script.StepRunner
      extended by 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.


Nested 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 looks almost exactly like some other exception, without actually having access to the instance of the original exception.
protected static class ForkedStepRunner.SlaveStepRunner
          When actually within the separate VM, this is what gets run.
 
Nested classes/interfaces inherited from class abbot.script.StepRunner
StepRunner.ExitHandler
 
Field Summary
(package private)  int LAUNCH_TIMEOUT
           
(package private)  int TERMINATE_TIMEOUT
           
 
Fields inherited from class abbot.script.StepRunner
helper, hierarchy
 
Constructor Summary
ForkedStepRunner()
           
ForkedStepRunner(StepRunner parent)
           
 
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, checkFile, clearErrors, createSecurityManager, fireStepEnd, fireStepError, fireStepEvent, fireStepFailure, fireStepProgress, fireStepStart, getCurrentContext, getError, getHierarchy, getStopOnError, getStopOnFailure, getTerminateOnError, installSecurityManager, launch, removeSecurityManager, removeStepListener, run, setError, setStopOnError, setStopOnFailure, setTerminateOnError, stop, stop, stopped, 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()

ForkedStepRunner

public ForkedStepRunner(StepRunner parent)
Method Detail

fork

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

fork

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

Throws:
UnknownHostException
IOException

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
Throws:
Throwable

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-2008 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge