Interface LockProvider


  • @Role
    public interface LockProvider
    A means of getting a lock for a specific object.
    Since:
    3.1M2
    Version:
    $Id: 978584c4d772f9ee02256f1a613998c1c623e7ee $
    • Method Detail

      • getLock

        ReadWriteLock getLock​(Object toLockOn)
        Get a lock for an object. If the object is equal to another object gotten through this function then the lock will be identical. As long as the lock is referenced IE: not garbage collected, the original object will be referenced as well so holding locks on large objects will cause memory leakage. Because of the guarantee of the same lock being used for equivilent objects, you can get locks as needed and throw them out when you are done with them.
        Parameters:
        toLockOn - the object to get a lock for.
        Returns:
        a lock for this object and any which are equal.