Class ReadLockManager
- java.lang.Object
-
- org.eclipse.persistence.internal.helper.ReadLockManager
-
public class ReadLockManager extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
FIRST_INDEX_OF_COLLECTION
-
Constructor Summary
Constructors Constructor Description ReadLockManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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.ReadLockManager
clone()
Create a new instanceReadLockManager
that is in all regards equal to the current instance.Map<Long,List<ReadLockAcquisitionMetadata>>
getMapThreadToReadLockAcquisitionMetadata()
Getter formapThreadToReadLockAcquisitionMetadata
List<ConcurrencyManager>
getReadLocks()
Return a set of the deferred locksList<String>
getRemoveReadLockProblemsDetected()
Getter 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 Detail
-
FIRST_INDEX_OF_COLLECTION
public static final int FIRST_INDEX_OF_COLLECTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
addReadLock
public void addReadLock(ConcurrencyManager concurrencyManager)
add a concurrency manager as deferred locks to the DLM
-
removeReadLock
public 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.- Parameters:
concurrencyManager
- the concurrency cache key that is about to be decrement in number of readers.
-
getReadLocks
public List<ConcurrencyManager> getReadLocks()
Return a set of the deferred locks
-
addRemoveReadLockProblemsDetected
public void addRemoveReadLockProblemsDetected(String problemDetected)
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
public Map<Long,List<ReadLockAcquisitionMetadata>> getMapThreadToReadLockAcquisitionMetadata()
Getter formapThreadToReadLockAcquisitionMetadata
-
getRemoveReadLockProblemsDetected
public List<String> 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
public ReadLockManager 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
-
-