info.aduna.collections.iterators
Class LockingIterator<E>
java.lang.Object
info.aduna.iteration.CloseableIterationBase<E,X>
info.aduna.iteration.IterationWrapper<E,X>
info.aduna.iteration.LockingIteration<E,RuntimeException>
info.aduna.collections.iterators.LockingIterator<E>
- All Implemented Interfaces:
- CloseableIterator<E>, CloseableIteration<E,RuntimeException>, Iteration<E,RuntimeException>, Closeable, Iterator<E>
public class LockingIterator<E>
- extends LockingIteration<E,RuntimeException>
- implements CloseableIterator<E>
An iterator that holds on to a lock until the iterator is closed. Upon
closing, the underlying iterator is closed before the lock is released.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LockingIterator
public LockingIterator(Lock lock,
Iterator<? extends E> iter)
- Creates a new LockingIterator.
- Parameters:
lock - The lock to release when the itererator is closed, must not be
null.iter - The underlying iterator, must not be null.
Copyright © 1997-2008 Aduna. All Rights Reserved.