Class ClassLocking


  • public class ClassLocking
    extends java.lang.Object
    This class is injectable to Vespa plugins and is used to acquire locks cross application deployments.
    Author:
    valerijf
    • Constructor Detail

      • ClassLocking

        public ClassLocking()
    • Method Detail

      • lock

        public ClassLock lock​(java.lang.Class<?> clazz)
        Locks key. This will block until the key is acquired. Users of this must close any lock acquired.
      • lockWhile

        public ClassLock lockWhile​(java.lang.Class<?> clazz,
                                   java.util.function.BooleanSupplier interruptCondition)
        Locks key. This will block until the key is acquired or the interrupt condition is no longer true. Condition is only checked at the start, everytime a lock is released and when interrupt() is called. Users of this must close any lock acquired.
        Throws:
        LockInterruptException - if interruptCondition returned false before the lock could be acquired