java.lang.Object
org.eclipse.persistence.internal.helper.ReadLockManager

public class ReadLockManager extends Object
  • Field Details

    • FIRST_INDEX_OF_COLLECTION

      public static final int FIRST_INDEX_OF_COLLECTION
      See Also:
  • Constructor Details

    • ReadLockManager

      public ReadLockManager()
  • Method Details

    • 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 for mapThreadToReadLockAcquisitionMetadata
    • getRemoveReadLockProblemsDetected

      public List<String> getRemoveReadLockProblemsDetected()
      Getter for removeReadLockProblemsDetected
    • 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 instance ReadLockManager 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

      Overrides:
      clone in class Object