org.entityfs.util.itr
Class AbstractLockingIterator
java.lang.Object
org.entityfs.util.itr.AbstractLockingIterator
- Direct Known Subclasses:
- AbstractNoLockingIterator, AbstractPessimisticLockingIterator, OptimisticLockingDepthLastIterator
public abstract class AbstractLockingIterator
- extends Object
An abstract base class for LockingIterator
:s. It implements the
unlock(EntityView)
and unlockAll()
methods.
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractLockingIterator
protected AbstractLockingIterator(boolean writeLock)
assertNotUnlocked
protected void assertNotUnlocked()
throws IllegalStateException
- Verify that the client has not called
unlockAll()
.
- Throws:
IllegalStateException
- If the client has called
unlockAll()
.
lock
protected void lock(EntityView ev)
- Subclasses call this to lock an entity.
- Parameters:
ev
- The entity to lock.
unlock
public void unlock(EntityView ev)
throws EntityNotFoundException
- Throws:
EntityNotFoundException
unlockAll
public void unlockAll()