jconch.pipeline.impl
Class ClosureConsumer<T>

java.lang.Object
  extended by jconch.pipeline.PipeStage
      extended by jconch.pipeline.Consumer<T>
          extended by jconch.pipeline.impl.ClosureConsumer<T>
All Implemented Interfaces:
PipeElement

public abstract class ClosureConsumer<T>
extends Consumer<T>

A Closure-based implementation of a Consumer.

Author:
Robert Fischer

Constructor Summary
ClosureConsumer(org.apache.commons.collections.Closure sink, ThreadingModel threading, PipeLink<T> in)
          Constructor.
 
Method Summary
 void consumeItem(java.lang.Object item)
          Delegates implementation to Closure.execute(Object).
 
Methods inherited from class jconch.pipeline.Consumer
execute, getLinkIn, isFinished
 
Methods inherited from class jconch.pipeline.PipeStage
getThreadingModel, isStarted, logMessage, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClosureConsumer

public ClosureConsumer(org.apache.commons.collections.Closure sink,
                       ThreadingModel threading,
                       PipeLink<T> in)
Constructor.

Parameters:
sink - The implementation of the consumption.
threading - The model for this consumer to use.
in - The link into this stage.
Throws:
org.apache.commons.lang.NullArgumentException - If any argument is null
Method Detail

consumeItem

public void consumeItem(java.lang.Object item)
Delegates implementation to Closure.execute(Object).

Specified by:
consumeItem in class Consumer<T>
Parameters:
item - The item to consume; never null