Annotation Type Lock


  • @InterceptorBinding
    @Inherited
    @Target({TYPE,METHOD})
    @Retention(RUNTIME)
    public @interface Lock
    Defines a concurrency lock for a bean.

    The container provides a built-in interceptor for this interceptor binding. Each interceptor instance associated with a contextual instance of an intercepted bean holds a ReadWriteLock instance with non-fair ordering policy.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      long time
      If it's not possible to acquire the lock in the given time a LockException is thrown.
      TimeUnit unit  
      Lock.Type value  
    • Element Detail

      • value

        Lock.Type value
        Returns:
        the type of the lock
        Default:
        io.quarkus.arc.Lock.Type.WRITE
      • unit

        TimeUnit unit
        Returns:
        the wait time unit
        Default:
        java.util.concurrent.TimeUnit.MILLISECONDS