stella.xml
Class XMLErrorFinalizer.ErrorDistributor

java.lang.Object
  extended by java.lang.Thread
      extended by stella.xml.XMLErrorFinalizer.ErrorDistributor
All Implemented Interfaces:
Runnable
Enclosing class:
XMLErrorFinalizer

protected class XMLErrorFinalizer.ErrorDistributor
extends Thread

Helper class to speed up the return from the error listener method ErrorListener.errorOccured(stella.ErrorEvent). This class simply updates the sequencer's steps according to the sequence found in the constructor file and according to the method stated.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  String method
          The method of error handling.
private  URL newseq
          Only stored for debuggin reference.
private  Sequencing sequencer
          The sequencer whose steps are to be changed.
private  DOMSequence update
          The new dom sequence.
private  boolean valid
          True, if new sequence file could be parsed in a DOMSequence.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
XMLErrorFinalizer.ErrorDistributor(URL seq, String how, Sequencing oldstep)
          Constructs a new error distributor.
 
Method Summary
 boolean isValid()
          Returns true if the alternate DOMSequence is valid.
 void run()
          Updates the sequencer's steps with the new sequence.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

method

private String method
The method of error handling.


sequencer

private Sequencing sequencer
The sequencer whose steps are to be changed.


update

private DOMSequence update
The new dom sequence.


valid

private boolean valid
True, if new sequence file could be parsed in a DOMSequence.


newseq

private URL newseq
Only stored for debuggin reference.

Constructor Detail

XMLErrorFinalizer.ErrorDistributor

public XMLErrorFinalizer.ErrorDistributor(URL seq,
                                          String how,
                                          Sequencing oldstep)
Constructs a new error distributor. Does not start automatically. Remebers the new sequncing steps provided in the argumental file and the type of appliance of the alternate sequence.

Method Detail

isValid

public boolean isValid()
Returns true if the alternate DOMSequence is valid. Only then the error dstributor should be started.


run

public void run()
Updates the sequencer's steps with the new sequence. The method defines whether the new sequnce replaces, appends or prepends to the original one. If the type of method is unknown, replacement is assumed.
This method works solely with XMLSequencer objects. The correct type is checked already at the sequncer registering stage.

To allow the error finalizer to determine the finalizing state of the finalizer, the distributor joins on the sequencer thread in case of XMLErrorFinalizer.ABORT errors.

Specified by:
run in interface Runnable
Overrides:
run in class Thread