|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EntityLockAdapter
This is an extension of the LockAdapter
that is used by entity
objects. It contains methods for accessing the entity's read and write locks,
and for creating custom locks for an entity object.
This interface is never used by file system clients directly (as a difference
to LockAdapter
). They use the locking methods defined in
EntityView
instead. locking methods on
LockAcquiringStrategy
,
EntityLockAdapterFactory
Method Summary | |
---|---|
void |
createEntityLockForIdentifier(Object identifier,
boolean readLock,
boolean writeLock)
This must be called before using a lock to ensure that it exists in the lock adapter. |
EntityLock |
getEntityLock(Object identifier)
Get the lock identified by the identifier. |
EntityLock |
getReadLock()
Get the entity's read lock. |
EntityLock |
getWriteLock()
|
boolean |
isReadLockedByCurrentThread()
|
boolean |
isWriteLockedByCurrentThread()
|
Methods inherited from interface org.entityfs.lock.LockAdapter |
---|
createLockForIdentifier, getLock |
Method Detail |
---|
EntityLock getReadLock()
EntityLockAdapterFactory
used by the file system.
EntityLock getWriteLock()
boolean isReadLockedByCurrentThread()
boolean isWriteLockedByCurrentThread()
void createEntityLockForIdentifier(Object identifier, boolean readLock, boolean writeLock)
Locks created by calling this method can later be retrieved by calling
getEntityLock(Object)
.
identifier
- An identifier that is unique for the lock-using object.
This may be any kind of object, a static Object
constant, for
instance.readLock
- Is the lock a read lock? I.e., should the lock's
isReadLock()
method return true
?writeLock
- Is the lock a write lock? I.e., should the lock's
isWriteLock()
method return true
?EntityLock getEntityLock(Object identifier)
createEntityLockForIdentifier(Object, boolean, boolean)
before
it can be retrieved by this method.
identifier
- The identifier for the lock. The identifier for each
defined lock is unique in the lock using object.
null
if no lock is defined for the
identifier.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |