Interface ObjectLock

    • Method Detail

      • doInWriteLock

        void doInWriteLock​(String objectId,
                           Runnable doInLock)
        Executes the code block after securing a write lock on the objectId. The lock is released after the block completes.
        Parameters:
        objectId - id of the object
        doInLock - block to execute within the lock
      • doInWriteLock

        <T> T doInWriteLock​(String objectId,
                            Callable<T> doInLock)
        Executes the code block after securing a write lock on the objectId. The lock is released after the block completes.
        Type Parameters:
        T - return type
        Parameters:
        objectId - id of the object
        doInLock - block to execute within the lock
        Returns:
        object