org.jplate.foundation.gof.cor
Interface ChainOfResponsibilityIfc<V,P extends ProcessorIfc<V>>

Type Parameters:
V - The object to be processed.
P - The processors in the chain.
All Superinterfaces:
ProcessorIfc<V>
All Known Implementing Classes:
DefaultChainOfResponsibility

public interface ChainOfResponsibilityIfc<V,P extends ProcessorIfc<V>>
extends ProcessorIfc<V>

Defines the "Gang of Four" Chain of Responsibility pattern: "Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it," p223 Design Patterns - Elements of Reusable Object-Oriented Software.
Please note: implementations may opt to stop requesting processors in the chain from processing if those processor return null on call to the ProcessorIfc.process(V) method. The default implementation DefaultChainOfResponsibility does just this.


Modifications:
    $Date: 2008-12-02 12:32:45 -0500 (Tue, 02 Dec 2008) $
    $Revision: 479 $
    $Author: sfloess $
    $HeadURL: https://jplate.svn.sourceforge.net/svnroot/jplate/trunk/src/dev/java/org/jplate/foundation/gof/cor/ChainOfResponsibilityIfc.java $
    


Method Summary
 java.util.List<P> getProcessors()
          Returns the processors who make up the chain.
 
Methods inherited from interface org.jplate.foundation.processor.ProcessorIfc
process
 

Method Detail

getProcessors

java.util.List<P> getProcessors()
Returns the processors who make up the chain. This method may be used to add/remove processors. Implementations must ensure thread-safety in a multi-threaded environment.

Returns:
the list of processors who make up the chain.