Module org.eclipse.persistence.core
Class ReadLockManager
java.lang.Object
org.eclipse.persistence.internal.helper.ReadLockManager
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addReadLock
(ConcurrencyManager concurrencyManager) add a concurrency manager as deferred locks to the DLMvoid
addRemoveReadLockProblemsDetected
(String problemDetected) Allow the concurrency manager to directly pump a message stating that there was a problem while decrementing the number of readers.clone()
Create a new instanceReadLockManager
that is in all regards equal to the current instance.Getter formapThreadToReadLockAcquisitionMetadata
Return a set of the deferred locksGetter forremoveReadLockProblemsDetected
boolean
isEmpty()
True if the tracing the data on the object has been completely removed.void
removeReadLock
(ConcurrencyManager concurrencyManager) During normal operation of the concurrency manager, each time a cache key is decrement in the number of readers, so must the corresponding read lock manager of the thread be told let go of the cache key object acquired for reading.
-
Field Details
-
FIRST_INDEX_OF_COLLECTION
public static final int FIRST_INDEX_OF_COLLECTION- See Also:
-
-
Constructor Details
-
ReadLockManager
public ReadLockManager()
-
-
Method Details
-
addReadLock
add a concurrency manager as deferred locks to the DLM -
removeReadLock
During normal operation of the concurrency manager, each time a cache key is decrement in the number of readers, so must the corresponding read lock manager of the thread be told let go of the cache key object acquired for reading.- Parameters:
concurrencyManager
- the concurrency cache key that is about to be decrement in number of readers.
-
getReadLocks
Return a set of the deferred locks -
addRemoveReadLockProblemsDetected
Allow the concurrency manager to directly pump a message stating that there was a problem while decrementing the number of readers.- Parameters:
problemDetected
- the detected problem
-
getMapThreadToReadLockAcquisitionMetadata
Getter formapThreadToReadLockAcquisitionMetadata
-
getRemoveReadLockProblemsDetected
Getter forremoveReadLockProblemsDetected
-
isEmpty
public boolean isEmpty()True if the tracing the data on the object has been completely removed. If this is the case it is perfectly fine to remove the read lock manager from from the hash map of Thread To tis ReadLockManager Tracing.- Returns:
- true if the current read lock manger contains no information about acquired locks that were never released or any errors detected while attempting to remove a cache key. If there is any error detected or any read lock acquired in the tracing we definitely do not want this object instance to be thrown out from our main tracing. It is probably revealing problems in read lock acquisition and released.
-
clone
Create a new instanceReadLockManager
that is in all regards equal to the current instance.USE CASE:
This method is meant to be used by algorithms that want to dump a snapshot of the current state of the system or to go about doing
-