org.jcreme.processing
Class ConsumerRunnable

java.lang.Object
  extended byorg.jcreme.processing.ConsumerRunnable
All Implemented Interfaces:
java.lang.Runnable

public class ConsumerRunnable
extends java.lang.Object
implements java.lang.Runnable

This class is designed to act as a data sink. It is a greedy runnable, it consumes the objects as soon as possible and makes a blocking call if no item is readily available.

Version:
$Revision: 1.1 $
Author:
$Author: dbregeon $

Constructor Summary
ConsumerRunnable(Consumer sink)
          Creates new ConsumerRunnable
 
Method Summary
 Consumer getSink()
          Gives access to the underlying sink.
 void run()
          The actual consumption process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsumerRunnable

public ConsumerRunnable(Consumer sink)
                 throws java.lang.IllegalArgumentException
Creates new ConsumerRunnable

Parameters:
sink - The consumer that will consumes the items.
Throws:
java.lang.IllegalArgumentException - if sink is null.
Method Detail

run

public void run()
The actual consumption process.

Specified by:
run in interface java.lang.Runnable

getSink

public Consumer getSink()
Gives access to the underlying sink.

Returns:
the Consumer animated by this Runnable.


Copyright 2006 null. All Rights Reserved.