Top Fields Constructors Methods
org.eclipse.persistence.internal.helper

public Class ReadLockManager

extends Object
Class Inheritance
Imports
org.eclipse.persistence.internal.helper.type.ReadLockAcquisitionMetadata, java.util.*

Field Summary

Modifier and TypeField and Description
public static final int
private final Map<Long, List<ReadLockAcquisitionMetadata>>
mapThreadToReadLockAcquisitionMetadata

We have seen that the read locks vector we have is very insufficient.

private final Vector<ConcurrencyManager>
readLocks

This vector of read locks is essentially a basket of cache keys (classes that extend concurrency manager) that a specific thread has acquired for reading.

private final List<String>
removeReadLockProblemsDetected

This is a field that will never be cleared.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized void
addReadLock(ConcurrencyManager concurrencyManager)

add a concurrency manager as deferred locks to the DLM

public synchronized void
addRemoveReadLockProblemsDetected(String
the detected problem
problemDetected
)

Allow the concurrency manager to directly pump a message stating that there was a problem while decrementing the number of readers.

public synchronized ReadLockManager
clone()

Overrides java.lang.Object.clone.

Create a new instance ReadLockManager that is in all regards equal to the current instance.
public Map<Long, List<ReadLockAcquisitionMetadata>>
public synchronized List<ConcurrencyManager>
getReadLocks()

Return a set of the deferred locks

public List<String>
public synchronized boolean

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.
isEmpty
()

True if the tracing the data on the object has been completely removed.

public synchronized void
removeReadLock(ConcurrencyManager
the concurrency cache key that is about to be decrement in number of readers.
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.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FIRST_INDEX_OF_COLLECTIONback to summary
public static final int FIRST_INDEX_OF_COLLECTION
mapThreadToReadLockAcquisitionMetadataback to summary
private final Map<Long, List<ReadLockAcquisitionMetadata>> mapThreadToReadLockAcquisitionMetadata

We have seen that the read locks vector we have is very insufficient. We keep it for now due to the tracing code that is making use of it. But we also want to have a new tracing map with a lot more metadata

readLocksback to summary
private final Vector<ConcurrencyManager> readLocks

This vector of read locks is essentially a basket of cache keys (classes that extend concurrency manager) that a specific thread has acquired for reading. We need to create this additional logic in order to be able to reduce the readers count on a cache key whenever

removeReadLockProblemsDetectedback to summary
private final List<String> removeReadLockProblemsDetected

This is a field that will never be cleared. It will be getting ADDs if any problem is detected when we try remove a read lock from our tracing.

Constructor Detail

ReadLockManagerback to summary
public ReadLockManager()

Method Detail

addReadLockback to summary
public synchronized void addReadLock(ConcurrencyManager concurrencyManager)

add a concurrency manager as deferred locks to the DLM

addRemoveReadLockProblemsDetectedback to summary
public synchronized 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:String

the detected problem

cloneback to summary
public synchronized ReadLockManager clone()

Overrides java.lang.Object.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

Returns:ReadLockManager

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
getMapThreadToReadLockAcquisitionMetadataback to summary
public Map<Long, List<ReadLockAcquisitionMetadata>> getMapThreadToReadLockAcquisitionMetadata()

Getter for mapThreadToReadLockAcquisitionMetadata

getReadLocksback to summary
public synchronized List<ConcurrencyManager> getReadLocks()

Return a set of the deferred locks

getRemoveReadLockProblemsDetectedback to summary
public List<String> getRemoveReadLockProblemsDetected()

Getter for removeReadLockProblemsDetected

isEmptyback to summary
public synchronized 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:boolean

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.

removeReadLockback to summary
public synchronized 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:ConcurrencyManager

the concurrency cache key that is about to be decrement in number of readers.