Class BasicEvictableLockManager<T extends ILockObject>

java.lang.Object
com.j_spaces.kernel.locks.BasicEvictableLockManager<T>
All Implemented Interfaces:
IBasicLockManager<T>

public class BasicEvictableLockManager<T extends ILockObject> extends Object implements IBasicLockManager<T>
Since:
7.01 basic lock manager implementation for evictable-cache, if the subject is an evictable object we use a representing object
Version:
1.0
Author:
Yechiel Fefer
  • Constructor Details

    • BasicEvictableLockManager

      public BasicEvictableLockManager(SpaceConfigReader configReader)
  • Method Details

    • getLockObject

      public ILockObject getLockObject(T subject)
      Description copied from interface: IBasicLockManager
      based on subject, return a lock object in order to lock the represented subject.

      If the subject is part of evictable from space (like lru) or evicatble from cache (like in TieredStorage with cache rule) we use the subject itself, otherwise we use per-logical subject a different object.

      Note - template and transient entry are not evictable.

      Specified by:
      getLockObject in interface IBasicLockManager<T extends ILockObject>
      Returns:
      the lock object
    • getLockObject

      public ILockObject getLockObject(String subjectUid)
      Description copied from interface: IBasicLockManager
      based only on subject's uid, return a lock object in order to lock the represented subject this method is relevant only for evictable objects
      Specified by:
      getLockObject in interface IBasicLockManager<T extends ILockObject>
      Returns:
      the lock object
    • freeLockObject

      public void freeLockObject(ILockObject lockObject)
      Description copied from interface: IBasicLockManager
      free the lock object - no more needed by this thread
      Specified by:
      freeLockObject in interface IBasicLockManager<T extends ILockObject>
      Parameters:
      lockObject - the lock object
    • isEntryLocksItsSelf

      public boolean isEntryLocksItsSelf(T entry)
      Description copied from interface: IBasicLockManager
      true if the lock object is the subject itself (i.e. entry or template), false if it is representing object. Note - this method is for entries only!.
      Specified by:
      isEntryLocksItsSelf in interface IBasicLockManager<T extends ILockObject>
      Returns:
      true if is the subject itself