org.mule.streaming
Class PagingDelegateProducer<T>

java.lang.Object
  extended by org.mule.streaming.PagingDelegateProducer<T>
All Implemented Interfaces:
Closeable, Producer<List<T>>, ProvidesTotalHint

public class PagingDelegateProducer<T>
extends Object
implements Producer<List<T>>

Implementation of Producer that uses an instance of PagingDelegate to get its results

Since:
3.5.0

Constructor Summary
PagingDelegateProducer(PagingDelegate<T> delegate)
           
 
Method Summary
 void close()
          Closes the delegate
 List<T> produce()
          Asks the delegate for the next page
 int size()
          Returns the total amount of available results informed by delegate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PagingDelegateProducer

public PagingDelegateProducer(PagingDelegate<T> delegate)
Method Detail

produce

public List<T> produce()
Asks the delegate for the next page

Specified by:
produce in interface Producer<List<T>>
Returns:
an item. Might be null

size

public int size()
Returns the total amount of available results informed by delegate

Specified by:
size in interface ProvidesTotalHint

close

public void close()
           throws MuleException
Closes the delegate

Specified by:
close in interface Closeable
Throws:
MuleException - if an exception occurs closing the resource


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.