org.entityfs.util.itr
Class AbstractPessimisticLockingIterator

java.lang.Object
  extended by org.entityfs.util.itr.AbstractLockingIterator
      extended by org.entityfs.util.itr.AbstractPessimisticLockingIterator
All Implemented Interfaces:
Iterator<EntityView>, LockingIterator<EntityView>
Direct Known Subclasses:
PessimisticLockingDepthFirstIterator, PessimisticLockingDepthLastIterator

public abstract class AbstractPessimisticLockingIterator
extends AbstractLockingIterator
implements LockingIterator<EntityView>

An abstract base class for pessimistic locking iterators. Locks are always acquired depth last.

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

Constructor Summary
protected AbstractPessimisticLockingIterator(DirectoryView dv, boolean writeLock, boolean depthLast, Filter<? super EntityView> filter)
           
 
Method Summary
 boolean hasNext()
           
 EntityView next()
           
 void 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
 

Constructor Detail

AbstractPessimisticLockingIterator

protected AbstractPessimisticLockingIterator(DirectoryView dv,
                                             boolean writeLock,
                                             boolean depthLast,
                                             Filter<? super EntityView> filter)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<EntityView>

next

public EntityView next()
Specified by:
next in interface Iterator<EntityView>

remove

public void remove()
Specified by:
remove in interface Iterator<EntityView>