org.jfree.layouting.util
Class ChainingComponent

java.lang.Object
  extended by org.jfree.layouting.util.ChainingComponent
Direct Known Subclasses:
ChainingRenderer, RecordingContentNormalizer

public abstract class ChainingComponent
extends java.lang.Object

A chaining component accepts calls from outside, forwards them to its wrapped object, and records all calls to the next chain element. Only after the initial call has been fully completed (and thus the wrapped object is back in a consistent state) all generated sub-calls will be forwarded to the next chain element. Of course, the whole architecture assumes, that the execution flow is a one-way street and that the execution and computation of the n-th step does not rely on results and/or the current state of the n+1-th step. It is guaranteed, that all calls are executed in the same order they have been recorded.

Author:
Thomas Morgner

Nested Class Summary
static class ChainingComponent.RecordedCall
           
 
Field Summary
static int STATE_DONE
           
static int STATE_ERROR
           
static int STATE_FRESH
           
 
Constructor Summary
ChainingComponent()
           
 
Method Summary
 void addCall(ChainingComponent.RecordedCall c)
           
 void clear()
           
protected abstract  void invoke(java.lang.Object target, int methodId, java.lang.Object parameters)
           
 void replay(java.lang.Object target)
           
protected  ChainingComponent.RecordedCall[] retrieveRecordedCalls()
           
 void setRecordedCalls(ChainingComponent.RecordedCall[] recordedCalls)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_FRESH

public static final int STATE_FRESH
See Also:
Constant Field Values

STATE_ERROR

public static final int STATE_ERROR
See Also:
Constant Field Values

STATE_DONE

public static final int STATE_DONE
See Also:
Constant Field Values
Constructor Detail

ChainingComponent

public ChainingComponent()
Method Detail

addCall

public void addCall(ChainingComponent.RecordedCall c)

clear

public void clear()

retrieveRecordedCalls

protected ChainingComponent.RecordedCall[] retrieveRecordedCalls()

setRecordedCalls

public void setRecordedCalls(ChainingComponent.RecordedCall[] recordedCalls)

replay

public void replay(java.lang.Object target)
            throws ChainingCallException
Throws:
ChainingCallException

invoke

protected abstract void invoke(java.lang.Object target,
                               int methodId,
                               java.lang.Object parameters)
                        throws java.lang.Exception
Throws:
java.lang.Exception