Interface MOLockStrategy

  • All Known Implementing Classes:
    DefaultMOLockStrategy


    public interface MOLockStrategy
    The MOLockStrategy interface defines a strategy for locking ManagedObject instances when they are accessed through a MOServer.
    Since:
    2.4.0
    Author:
    Frank Fock
    • Method Detail

      • isLockNeeded

        boolean isLockNeeded​(ManagedObject<?> managedObjectLookedUp,
                             MOQuery query)
        Check if the server access to the provided managed object needs a lock.
        Parameters:
        managedObjectLookedUp - the ManagedObject instance that is looked up and potentially accessed.
        query - the query on which behalf the lookup took place. It also signals with MOQuery.isWriteAccessQuery() whether a write access is intended or not.
        Returns:
        true if a lock is required to access the provided managed object, false otherwise.