jconch.pipeline.impl
Class FactoryProducer

java.lang.Object
  extended by jconch.pipeline.PipelineStage
      extended by jconch.pipeline.Producer
          extended by jconch.pipeline.impl.FactoryProducer

public abstract class FactoryProducer
extends Producer

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

Author:
Robert Fischer

Field Summary
 
Fields inherited from class jconch.pipeline.Producer
link
 
Constructor Summary
protected FactoryProducer(Factory source, ThreadingModel threading, PipeLink link)
          Constructor.
 
Method Summary
protected  boolean isExhausted()
          Determines if the pipeline stage will not produce any more elements.
 Object produceItem()
          Method that must be implemented to queue the producer.
 
Methods inherited from class jconch.pipeline.Producer
execute, getLinkOut, 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

FactoryProducer

protected FactoryProducer(Factory source,
                          ThreadingModel threading,
                          PipeLink link)
Constructor.

Parameters:
source - The factory that will be called to produce new elements.
threading - The threading model.
link - The link we produce things into.
Throws:
org.apache.commons.lang.NullArgumentException - If any argument is null.
Method Detail

isExhausted

protected boolean isExhausted()
Description copied from class: Producer
Determines if the pipeline stage will not produce any more elements. This may be called more than once, and once it returns true, it shall always return true.

Specified by:
isExhausted in class Producer
Returns:
If the stage is exhausted.

produceItem

public Object produceItem()
Description copied from class: Producer
Method that must be implemented to queue the producer.

Specified by:
produceItem in class Producer
Returns:
The next item for the producer, or null if there are no more elements.