Class SharedDataIteratorSource<T>
java.lang.Object
com.gigaspaces.datasource.concurrentaccess.SharedDataIteratorSource<T>
Used to create
SharedDataIterator over a single DataIterator, the iterator source
is in charge of mediating between the shared iterators, always only one shared iterator is
accessing the actual iterator- Since:
- 7.0
- Author:
- eitany
-
Constructor Summary
ConstructorsConstructorDescriptionSharedDataIteratorSource(Object identifier, ISourceDataIteratorProvider<T> sourceDataIteratorProvider, long timeToLive) Construct a new source -
Method Summary
Modifier and TypeMethodDescriptionvoidSubscribe to state changed eventsvoidSignal the source this shared data iterator is closedGets a new shared data iterator over the source data iteratorgetNext(int index) Called by the shared iterators to get their next object according to the specified index
-
Constructor Details
-
SharedDataIteratorSource
public SharedDataIteratorSource(Object identifier, ISourceDataIteratorProvider<T> sourceDataIteratorProvider, long timeToLive) Construct a new source- Parameters:
sourceDataIterator- data iterator to wraptimeToLive- time in miliseconds that once elapsed this iterator source is considered expired and will no longer receive requests for new iterators
-
-
Method Details
-
getIterator
public DataIterator<T> getIterator() throws SharedDataIteratorSourceClosedException, SharedDataIteratorSourceExpiredException, DataSourceExceptionGets a new shared data iterator over the source data iterator -
getNext
Called by the shared iterators to get their next object according to the specified index- Parameters:
index- specified index
-