|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.lock.impl.AbstractLockAcquiringStrategy
public abstract class AbstractLockAcquiringStrategy
Abstract base class for lock acquiring strategy classes. Subclasses only have
to implement the lockIt(Lock)
method.
Constructor Summary | |
---|---|
AbstractLockAcquiringStrategy()
|
Method Summary | |
---|---|
EntityLock |
getEntityLock(Object identifier,
EntityLockAdapter la,
LogAdapter lga)
Get a custom entity lock for an entity from its lock adapter. |
Lock |
getLock(Object identifier,
LockAdapter la,
LogAdapter lga)
Lock a custom lock that is not tied to any specific entity. |
EntityLock |
getReadLock(EntityLockAdapter la,
LogAdapter lga)
Get a locked read lock for an entity from its lock adapter. |
EntityLock |
getWriteLock(EntityLockAdapter la,
LogAdapter lga)
Get a locked write lock for an entity from its lock adapter. |
protected abstract boolean |
lockIt(Lock l)
Subclasses implement this to lock the given lock. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractLockAcquiringStrategy()
Method Detail |
---|
protected abstract boolean lockIt(Lock l) throws InterruptedException
l
- The lock.
true
if successful, false
otherwise. When false
is returned, it is interpreted as due to a timeout.
InterruptedException
- If the thread is interrupted while trying to
acquire the lock.public final EntityLock getReadLock(EntityLockAdapter la, LogAdapter lga)
LockAcquiringStrategy
getReadLock
in interface LockAcquiringStrategy
la
- The entity's lock adapter.lga
- The file system's current log adapter.
public EntityLock getWriteLock(EntityLockAdapter la, LogAdapter lga)
LockAcquiringStrategy
getWriteLock
in interface LockAcquiringStrategy
la
- The entity's lock adapter.lga
- The file system's current log adapter.
public EntityLock getEntityLock(Object identifier, EntityLockAdapter la, LogAdapter lga)
LockAcquiringStrategy
createEntityLockForIdentifier(Object, boolean, boolean)
method before it
can be locked.
getEntityLock
in interface LockAcquiringStrategy
identifier
- The unique identifier for the lock.la
- The entity's lock adapterlga
- The file system's current log adapter.
public Lock getLock(Object identifier, LockAdapter la, LogAdapter lga)
LockAcquiringStrategy
createLockForIdentifier(Object)
method before it can be locked.
getLock
in interface LockAcquiringStrategy
identifier
- The unique identifier for the lock.la
- The lock adapter.lga
- A log adapter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |