Class DeferredLockManager
- java.lang.Object
-
- org.eclipse.persistence.internal.helper.DeferredLockManager
-
public class DeferredLockManager extends java.lang.ObjectINTERNAL:Purpose: Be used for deadlock avoidance through allowing detection and resolution.
Responsibilities:
- Keep track of all deferred locks of each thread.
- Keep track of all active locks of each thread..
- Maintain the depth of the each thread.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.VectoractiveLocksprotected java.util.VectordeferredLocksprotected booleanisThreadCompletestatic booleanSHOULD_USE_DEFERRED_LOCKSprotected intthreadDepth
-
Constructor Summary
Constructors Constructor Description DeferredLockManager()DeferredLockManager constructor comment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActiveLock(java.lang.Object manager)add a concurrency manager as active locks to the DLMvoidaddDeferredLock(java.lang.Object manager)add a concurrency manager as deferred locks to the DLMvoiddecrementDepth()decrement the depth of the threadjava.util.VectorgetActiveLocks()Return a set of the active locks from the DLMjava.util.VectorgetDeferredLocks()Return a set of the deferred locksintgetThreadDepth()Return the depth of the thread associated with the DLM, being used to release the lockbooleanhasDeferredLock()Return if there are any deferred locks.voidincrementDepth()increment the depth of the threadbooleanisThreadComplete()Return if the thread is completevoidreleaseActiveLocksOnThread()Release the active lock on the DLMvoidsetActiveLocks(java.util.Vector activeLocks)set a set of the active locks to the DLMvoidsetDeferredLocks(java.util.Vector deferredLocks)set a set of the deferred locks to the DLMvoidsetIsThreadComplete(boolean isThreadComplete)set if the thread is complete in the given DLM
-
-
-
Method Detail
-
addActiveLock
public void addActiveLock(java.lang.Object manager)
add a concurrency manager as active locks to the DLM
-
addDeferredLock
public void addDeferredLock(java.lang.Object manager)
add a concurrency manager as deferred locks to the DLM
-
decrementDepth
public void decrementDepth()
decrement the depth of the thread
-
getActiveLocks
public java.util.Vector getActiveLocks()
Return a set of the active locks from the DLM
-
getDeferredLocks
public java.util.Vector getDeferredLocks()
Return a set of the deferred locks
-
getThreadDepth
public int getThreadDepth()
Return the depth of the thread associated with the DLM, being used to release the lock
-
hasDeferredLock
public boolean hasDeferredLock()
Return if there are any deferred locks.
-
incrementDepth
public void incrementDepth()
increment the depth of the thread
-
isThreadComplete
public boolean isThreadComplete()
Return if the thread is complete
-
releaseActiveLocksOnThread
public void releaseActiveLocksOnThread()
Release the active lock on the DLM
-
setActiveLocks
public void setActiveLocks(java.util.Vector activeLocks)
set a set of the active locks to the DLM
-
setDeferredLocks
public void setDeferredLocks(java.util.Vector deferredLocks)
set a set of the deferred locks to the DLM
-
setIsThreadComplete
public void setIsThreadComplete(boolean isThreadComplete)
set if the thread is complete in the given DLM
-
-