Module org.eclipse.persistence.core
Class DeferredLockManager
java.lang.Object
org.eclipse.persistence.internal.helper.DeferredLockManager
INTERNAL:
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
FieldsModifier and TypeFieldDescriptionprotected Vector<ConcurrencyManager> protected Vector<ConcurrencyManager> protected booleanstatic booleanprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActiveLock(Object manager) add a concurrency manager as active locks to the DLMvoidaddDeferredLock(Object manager) add a concurrency manager as deferred locks to the DLMvoiddecrement the depth of the threadReturn a set of the active locks from the DLMReturn a set of the deferred locksintReturn the depth of the thread associated with the DLM, being used to release the lockbooleanReturn if there are any deferred locks.voidincrement the depth of the threadbooleanReturn if the thread is completevoidRelease the active lock on the DLMvoidsetActiveLocks(Vector<ConcurrencyManager> activeLocks) set a set of the active locks to the DLMvoidsetDeferredLocks(Vector<ConcurrencyManager> deferredLocks) set a set of the deferred locks to the DLMvoidsetIsThreadComplete(boolean isThreadComplete) set if the thread is complete in the given DLM
-
Field Details
-
deferredLocks
-
activeLocks
-
threadDepth
protected int threadDepth -
isThreadComplete
protected boolean isThreadComplete -
SHOULD_USE_DEFERRED_LOCKS
public static boolean SHOULD_USE_DEFERRED_LOCKS
-
-
Constructor Details
-
DeferredLockManager
public DeferredLockManager()DeferredLockManager constructor comment.
-
-
Method Details
-
addActiveLock
add a concurrency manager as active locks to the DLM -
addDeferredLock
add a concurrency manager as deferred locks to the DLM -
decrementDepth
public void decrementDepth()decrement the depth of the thread -
getActiveLocks
Return a set of the active locks from the DLM -
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
set a set of the active locks to the DLM -
setDeferredLocks
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
-