org.jfree.layouting.util

Class ChainingComponent

Known Direct 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(Object target, int methodId, Object parameters)
void
replay(Object target)
protected ChainingComponent.RecordedCall[]
retrieveRecordedCalls()
void
setRecordedCalls(ChainingComponent.RecordedCall[] recordedCalls)

Field Details

STATE_DONE

public static final int STATE_DONE
Field Value:
2

STATE_ERROR

public static final int STATE_ERROR
Field Value:
1

STATE_FRESH

public static final int STATE_FRESH
Field Value:
0

Constructor Details

ChainingComponent

public ChainingComponent()

Method Details

addCall

public void addCall(ChainingComponent.RecordedCall c)

clear

public void clear()

invoke

protected abstract void invoke(Object target,
                               int methodId,
                               Object parameters)
            throws Exception

replay

public void replay(Object target)
            throws ChainingCallException

retrieveRecordedCalls

protected ChainingComponent.RecordedCall[] retrieveRecordedCalls()

setRecordedCalls

public void setRecordedCalls(ChainingComponent.RecordedCall[] recordedCalls)