org.entityfs.util.itr
Class OptimisticLockingDepthLastIterator
java.lang.Object
org.entityfs.util.itr.AbstractLockingIterator
org.entityfs.util.itr.OptimisticLockingDepthLastIterator
- All Implemented Interfaces:
- Iterator<EntityView>, DepthLastIterator<EntityView>, LockingDepthLastIterator<EntityView>, LockingIterator<EntityView>
public class OptimisticLockingDepthLastIterator
- extends AbstractLockingIterator
- implements LockingDepthLastIterator<EntityView>
This is a depth-last iterator (i.e. a breadth-first iterator) that will lock
returned entities optimistically. Optimistic locking means that the
entities will be locked as they are returned from the iterator.
Use AbstractLockingIterator.unlock(EntityView)
and/or AbstractLockingIterator.unlockAll()
to unlock the
returned entities. See LockingIterator
.
This class should have been named OptimisticLockingBreadthFirstIterator
...
EntityFS iterators are not thread safe. Don't use them concurrently from
several threads without synchronizing access to them.
- Since:
- 1.0
- Author:
- Karl Gustafsson
- See Also:
PessimisticLockingDepthFirstIterator
,
PessimisticLockingDepthLastIterator
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OptimisticLockingDepthLastIterator
public OptimisticLockingDepthLastIterator(DirectoryView dv)
OptimisticLockingDepthLastIterator
public OptimisticLockingDepthLastIterator(DirectoryView dv,
boolean writeLock)
OptimisticLockingDepthLastIterator
public OptimisticLockingDepthLastIterator(DirectoryView dv,
boolean writeLock,
Filter<? super EntityView> filter)
next
public EntityView next()
- Specified by:
next
in interface Iterator<EntityView>
remove
public void remove()
- Specified by:
remove
in interface Iterator<EntityView>
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<EntityView>