jconch.pipeline.impl
Class ClosureConsumer

java.lang.Object
  extended by jconch.pipeline.PipelineStage
      extended by jconch.pipeline.Consumer
          extended by jconch.pipeline.impl.ClosureConsumer

public abstract class ClosureConsumer
extends Consumer

A Closure-based implementation of a Consumer. Implementation Note: Due to a failing of generics, there is no type-safety available for this implementation.

Author:
Robert Fischer

Constructor Summary
protected ClosureConsumer(Closure sink, ThreadingModel threading, PipeLink in)
          Constructor.
 
Method Summary
 void consumeItem(Object item)
          Delegates implementation to Closure.execute(Object).
 
Methods inherited from class jconch.pipeline.Consumer
execute, getLinkIn, isFinished
 
Methods inherited from class jconch.pipeline.PipelineStage
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

protected ClosureConsumer(Closure sink,
                          ThreadingModel threading,
                          PipeLink 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(Object item)
Delegates implementation to Closure.execute(Object).

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