jconch.pipeline.impl
Class UnboundedPipeLink<T>

java.lang.Object
  extended by jconch.pipeline.PipeLink<T>
      extended by jconch.pipeline.impl.UnboundedPipeLink<T>

public class UnboundedPipeLink<T>
extends PipeLink<T>

An unbounded link in the pipeline. This is a very fast implementation of a link, but allows potentially unlimited elements to build up, which can be counter-productive to the multithreaded approach.

View Source

Version:
$Date: May 10, 2007 8:07:29 AM $
Author:
rfischer

Constructor Summary
UnboundedPipeLink()
          Creates a new intance of UnboundedPipeLink.
 
Method Summary
 int getRemainingCapacity()
          Have to override this because LinkedBlockingQueue.remainingCapacity() doesn't work as expected -- apparently an unbounded queue runs low on space after you insert elements.
 
Methods inherited from class jconch.pipeline.PipeLink
add, breakLink, clearQueue, get, getAddTimeout, getFetchTimeout, getQueueLength, registerSource, setAddTimeout, setFetchTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnboundedPipeLink

public UnboundedPipeLink()
Creates a new intance of UnboundedPipeLink.

Method Detail

getRemainingCapacity

public int getRemainingCapacity()
Have to override this because LinkedBlockingQueue.remainingCapacity() doesn't work as expected -- apparently an unbounded queue runs low on space after you insert elements. Provides an estimate of the number of elements the queue could additionally hold.

Overrides:
getRemainingCapacity in class PipeLink<T>
Returns:
An estimate of the capcity of the queue, or Integer.MAX_VALUE if it is unbounded.