|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.entityfs.util.itr.AbstractLockingIterator org.entityfs.util.itr.AbstractPessimisticLockingIterator org.entityfs.util.itr.PessimisticLockingDepthLastIterator
public final class PessimisticLockingDepthLastIterator
This is a depth-last iterator (i.e. a breadth-first iterator) that will
acquire locks for all returned entities pessimistically. Locks for all
entities that will be returned are acquired (depth last) the first time
next
or hasNext
is called.
Use AbstractLockingIterator.unlock(EntityView)
and/or AbstractLockingIterator.unlockAll()
to unlock the
returned entities. Always call AbstractLockingIterator.unlockAll()
if the aborting the
iteration before all entities have been returned from the iterator or if
using a filter for filtering returned entities. See LockingIterator
.
This class should have been named PessimisticLockingBreadthFirstIterator
...
EntityFS iterators are not thread safe. Don't use them concurrently from several threads without synchronizing access to them.
OptimisticLockingDepthLastIterator
,
PessimisticLockingDepthLastIterator
Constructor Summary | |
---|---|
PessimisticLockingDepthLastIterator(DirectoryView dv)
Create a pessimistic depth last iterator on the directory. |
|
PessimisticLockingDepthLastIterator(DirectoryView dv,
boolean writeLock)
Create a pessimistic depth last iterator on the directory. |
|
PessimisticLockingDepthLastIterator(DirectoryView dv,
boolean writeLock,
Filter<? super EntityView> filter)
Create a pessimistic depth last iterator on the directory. |
Method Summary |
---|
Methods inherited from class org.entityfs.util.itr.AbstractPessimisticLockingIterator |
---|
hasNext, next, remove |
Methods inherited from class org.entityfs.util.itr.AbstractLockingIterator |
---|
assertNotUnlocked, lock, unlock, unlockAll |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.entityfs.util.itr.LockingIterator |
---|
unlock, unlockAll |
Methods inherited from interface java.util.Iterator |
---|
hasNext, next, remove |
Constructor Detail |
---|
public PessimisticLockingDepthLastIterator(DirectoryView dv)
dv
- The directory.public PessimisticLockingDepthLastIterator(DirectoryView dv, boolean writeLock)
dv
- The directory.writeLock
- If true
, all returned entities are locked for
writing. If false
, all returned entities are locked for reading.public PessimisticLockingDepthLastIterator(DirectoryView dv, boolean writeLock, Filter<? super EntityView> filter)
dv
- The directory.writeLock
- If true
, all returned entities are locked for
writing. If false
, all returned entities are locked for reading.filter
- Only entities that pass this filter are returned from the
iterator.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |