|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.lock.impl.ReentrantLockAdapter
public class ReentrantLockAdapter
This is a LockAdapter
that uses ReentrantLock
:s that it
creates with a EntityLockFactory
.
Constructor Summary | |
---|---|
ReentrantLockAdapter(EntityLockFactory rlf)
|
Method Summary | |
---|---|
void |
createLockForIdentifier(Object identifier)
Create a lock for the unique (in the lock adapter instance) identifier. |
Lock |
getLock(Object identifier)
Get the lock identified by the identifier. |
protected EntityLockFactory |
getLockFactory()
|
protected void |
registerLock(Object identifier,
Lock l)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReentrantLockAdapter(EntityLockFactory rlf)
Method Detail |
---|
protected EntityLockFactory getLockFactory()
protected void registerLock(Object identifier, Lock l)
public void createLockForIdentifier(Object identifier)
LockAdapter
This must be called before using a lock to ensure that it exists in the lock adapter. It typically called by the lock-using object's constructor.
Locks created by calling this method can later be retrieved by calling
LockAdapter.getLock(Object)
.
createLockForIdentifier
in interface LockAdapter
identifier
- An identifier that is unique for the lock-using object.
This may be any kind of object, a static Object
constant, for
instance.public Lock getLock(Object identifier)
LockAdapter
LockAdapter.createLockForIdentifier(Object)
before it can
be retrieved by this method.
getLock
in interface LockAdapter
identifier
- The identifier for the lock. The identifier for each
defined lock is unique in the lock adapter instance.
null
if no lock is defined for the
identifier.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |