Class LockObject
- java.lang.Object
-
- org.apache.manifoldcf.core.lockmanager.LockObject
-
- Direct Known Subclasses:
FileLockObject,ZooKeeperLockObject
public class LockObject extends java.lang.ObjectBase class. One instance of this object exists for each lock on each JVM!
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected static java.lang.StringLOCKEDANOTHERJVMprotected static java.lang.StringLOCKEDANOTHERTHREADprotected java.lang.ObjectlockKey
-
Constructor Summary
Constructors Constructor Description LockObject(LockPool lockPool, java.lang.Object lockKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclearGlobalNonExWriteLock()protected voidclearGlobalNonExWriteLockNoWait()protected voidclearGlobalReadLock()protected voidclearGlobalReadLockNoWait()protected voidclearGlobalWriteLock()protected voidclearGlobalWriteLockNoWait()voidenterNonExWriteLock()voidenterNonExWriteLockNoWait()Note well: Upgrading a read lock to a non-ex write lock is tricky.voidenterReadLock()voidenterReadLockNoWait()voidenterWriteLock()This method WILL NOT BE CALLED UNLESS we are actually committing a write lock for the first time for a given thread.voidenterWriteLockNoWait()Note well: Upgrading a read lock to a non-ex write lock is tricky.booleanleaveNonExWriteLock()booleanleaveReadLock()booleanleaveWriteLock()voidmakeInvalid()protected voidobtainGlobalNonExWriteLock()protected voidobtainGlobalNonExWriteLockNoWait()protected voidobtainGlobalReadLock()protected voidobtainGlobalReadLockNoWait()protected voidobtainGlobalWriteLock()protected voidobtainGlobalWriteLockNoWait()
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
lockKey
protected final java.lang.Object lockKey
-
LOCKEDANOTHERTHREAD
protected static final java.lang.String LOCKEDANOTHERTHREAD
- See Also:
- Constant Field Values
-
LOCKEDANOTHERJVM
protected static final java.lang.String LOCKEDANOTHERJVM
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LockObject
public LockObject(LockPool lockPool, java.lang.Object lockKey)
-
-
Method Detail
-
makeInvalid
public void makeInvalid()
-
enterWriteLock
public void enterWriteLock() throws ManifoldCFException, java.lang.InterruptedException, ExpiredObjectExceptionThis method WILL NOT BE CALLED UNLESS we are actually committing a write lock for the first time for a given thread.- Throws:
ManifoldCFExceptionjava.lang.InterruptedExceptionExpiredObjectException
-
enterWriteLockNoWait
public void enterWriteLockNoWait() throws ManifoldCFException, LockException, LocalLockException, java.lang.InterruptedException, ExpiredObjectExceptionNote well: Upgrading a read lock to a non-ex write lock is tricky. The code inside the lock should execute only when there are NO threads that are executing in a read-locked area that aren't waiting to enter the non-ex write lock area! This is therefore essentially an illegal codepath, because it will lead inevitably to deadlock, as is going from a read-locked area into a write-locked area, or from a non-ex write area into an exclusive write area.- Throws:
ManifoldCFExceptionLockExceptionLocalLockExceptionjava.lang.InterruptedExceptionExpiredObjectException
-
obtainGlobalWriteLockNoWait
protected void obtainGlobalWriteLockNoWait() throws ManifoldCFException, LockException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionLockExceptionjava.lang.InterruptedException
-
obtainGlobalWriteLock
protected void obtainGlobalWriteLock() throws ManifoldCFException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionjava.lang.InterruptedException
-
leaveWriteLock
public boolean leaveWriteLock() throws ManifoldCFException, java.lang.InterruptedException, ExpiredObjectException- Throws:
ManifoldCFExceptionjava.lang.InterruptedExceptionExpiredObjectException
-
clearGlobalWriteLockNoWait
protected void clearGlobalWriteLockNoWait() throws ManifoldCFException, LockException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionLockExceptionjava.lang.InterruptedException
-
clearGlobalWriteLock
protected void clearGlobalWriteLock() throws ManifoldCFException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionjava.lang.InterruptedException
-
enterNonExWriteLock
public void enterNonExWriteLock() throws ManifoldCFException, java.lang.InterruptedException, ExpiredObjectException- Throws:
ManifoldCFExceptionjava.lang.InterruptedExceptionExpiredObjectException
-
enterNonExWriteLockNoWait
public void enterNonExWriteLockNoWait() throws ManifoldCFException, LockException, LocalLockException, java.lang.InterruptedException, ExpiredObjectExceptionNote well: Upgrading a read lock to a non-ex write lock is tricky. The code inside the lock should execute only when there are NO threads that are executing in a read-locked area that aren't waiting to enter the non-ex write lock area! This is therefore essentially an illegal codepath, because it will lead inevitably to deadlock, as is going from a read-locked area into a write-locked area, or from a non-ex write area into an exclusive write area.- Throws:
ManifoldCFExceptionLockExceptionLocalLockExceptionjava.lang.InterruptedExceptionExpiredObjectException
-
obtainGlobalNonExWriteLockNoWait
protected void obtainGlobalNonExWriteLockNoWait() throws ManifoldCFException, LockException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionLockExceptionjava.lang.InterruptedException
-
obtainGlobalNonExWriteLock
protected void obtainGlobalNonExWriteLock() throws ManifoldCFException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionjava.lang.InterruptedException
-
leaveNonExWriteLock
public boolean leaveNonExWriteLock() throws ManifoldCFException, java.lang.InterruptedException, ExpiredObjectException- Throws:
ManifoldCFExceptionjava.lang.InterruptedExceptionExpiredObjectException
-
clearGlobalNonExWriteLockNoWait
protected void clearGlobalNonExWriteLockNoWait() throws ManifoldCFException, LockException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionLockExceptionjava.lang.InterruptedException
-
clearGlobalNonExWriteLock
protected void clearGlobalNonExWriteLock() throws ManifoldCFException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionjava.lang.InterruptedException
-
enterReadLock
public void enterReadLock() throws ManifoldCFException, java.lang.InterruptedException, ExpiredObjectException- Throws:
ManifoldCFExceptionjava.lang.InterruptedExceptionExpiredObjectException
-
enterReadLockNoWait
public void enterReadLockNoWait() throws ManifoldCFException, LockException, LocalLockException, java.lang.InterruptedException, ExpiredObjectException- Throws:
ManifoldCFExceptionLockExceptionLocalLockExceptionjava.lang.InterruptedExceptionExpiredObjectException
-
obtainGlobalReadLockNoWait
protected void obtainGlobalReadLockNoWait() throws ManifoldCFException, LockException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionLockExceptionjava.lang.InterruptedException
-
obtainGlobalReadLock
protected void obtainGlobalReadLock() throws ManifoldCFException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionjava.lang.InterruptedException
-
leaveReadLock
public boolean leaveReadLock() throws ManifoldCFException, java.lang.InterruptedException, ExpiredObjectException- Throws:
ManifoldCFExceptionjava.lang.InterruptedExceptionExpiredObjectException
-
clearGlobalReadLockNoWait
protected void clearGlobalReadLockNoWait() throws ManifoldCFException, LockException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionLockExceptionjava.lang.InterruptedException
-
clearGlobalReadLock
protected void clearGlobalReadLock() throws ManifoldCFException, java.lang.InterruptedException- Throws:
ManifoldCFExceptionjava.lang.InterruptedException
-
-