org.mule.streaming
Class SimpleConsumer<T>
java.lang.Object
org.mule.streaming.AbstractConsumer<T,T>
org.mule.streaming.SimpleConsumer<T>
- All Implemented Interfaces:
- Closeable, Consumer<T>, ProvidesTotalHint
public class SimpleConsumer<T>
- extends AbstractConsumer<T,T>
Basic implementation of Consumer
that simply returns the objects returned
by the underlying Producer
- Since:
- 3.5.0
Method Summary |
protected boolean |
checkConsumed()
Implement this method to actualy check for the Producer being fully
consumed without worrying about it being closed or throwing any exceptions |
protected T |
doConsume()
Implement this method to actually consume the producer without worrying about
exception types or checking fo this consumer to be closed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleConsumer
public SimpleConsumer(Producer<T> producer)
doConsume
protected T doConsume()
throws NoSuchElementException
- Description copied from class:
AbstractConsumer
- Implement this method to actually consume the producer without worrying about
exception types or checking fo this consumer to be closed. If the producer is
consumed then simply return
null
- Specified by:
doConsume
in class AbstractConsumer<T,T>
- Returns:
- a new item or
null
- Throws:
NoSuchElementException
checkConsumed
protected boolean checkConsumed()
- Description copied from class:
AbstractConsumer
- Implement this method to actualy check for the
Producer
being fully
consumed without worrying about it being closed or throwing any exceptions
- Specified by:
checkConsumed
in class AbstractConsumer<T,T>
- Returns:
- whether the
Producer
has been consumed or not
Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.