org.mule.streaming
Class ListableObjectStoreProducer<T extends Serializable>

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

public class ListableObjectStoreProducer<T extends Serializable>
extends Object
implements Producer<T>

Implementation of Producer to stream the contents of a ListableObjectStore

Since:
3.5.0

Constructor Summary
ListableObjectStoreProducer(ListableObjectStore<T> objectStore)
           
 
Method Summary
 void close()
          Closes the resource.
 T produce()
          Returns the next available item
 int size()
          returns the total amount of items available for storage/processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListableObjectStoreProducer

public ListableObjectStoreProducer(ListableObjectStore<T> objectStore)
Method Detail

produce

public T produce()
Description copied from interface: Producer
Returns the next available item

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

size

public int size()
Description copied from interface: ProvidesTotalHint
returns the total amount of items available for storage/processing. In some scenarios, it might not be possible/convenient to actually retrieve this value or it might not be available at this point. -1 is returned in such a case.

Specified by:
size in interface ProvidesTotalHint

close

public void close()
           throws MuleException
Description copied from interface: Closeable
Closes the resource. Calling this method is mandatory for any component using this instance once it finishes using it. This method should not throw exception is invoked on an instance that has already been closed

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


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