org.prevayler.foundation
Class Turn

java.lang.Object
  extended by org.prevayler.foundation.Turn

public class Turn
extends Object

Used to control progression of threads through the stages of a processing pipeline.


Method Summary
 void abort(String message, Throwable cause)
          Abort the pipeline.
 void end()
          End a stage in the pipeline.
static Turn first()
          The first turn through a pipeline, allowed to flow freely through all stages.
 Turn next()
          The next turn through the pipeline, allowed to flow only as far as this turn has already gone.
 void start()
          Start a stage in the pipeline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

first

public static Turn first()
The first turn through a pipeline, allowed to flow freely through all stages.


next

public Turn next()
The next turn through the pipeline, allowed to flow only as far as this turn has already gone.

Throws:
IllegalStateException - if this or any preceding turn has been aborted.

start

public void start()
Start a stage in the pipeline. Will block until the preceding turn has ended the same stage.

Throws:
IllegalStateException - if this or any preceding turn has been aborted.

end

public void end()
End a stage in the pipeline. Allows the next turn to start the same stage.


abort

public void abort(String message,
                  Throwable cause)
Abort the pipeline. Prevents this or any following turn from continuing, but doesn't affect preceding turns already further along in the pipeline.

Throws:
IllegalStateException - always, with the given message and cause.


Copyright © 2001-2013. All Rights Reserved.