2009/04/15 - Apache HiveMind has been retired.

For more information, please explore the Attic.

Jakarta > HiveMind
Font size:      

hivemind.lib.ChainBuilder Service

The ChainBuilder service implements the Gang of Four Chain of Command pattern.

The ChainBuilder is provided with:

From this, the ChainBuilder creates a new chain implementation object. The chain object implements the command interface.

Invoking a method on the chain object will, in turn, re-invoke the same method, with the same parameters, on each command object.

If a command object returns a value that is not null, false or 0, then the chain terminates and returns that value. Command methods may take any number of parameters and may return any value type (including void).

Commands are free to throw a checked or unchecked exception; these are not caught by the chain.