Annotation Interface 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.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Optional Element Summary

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

    • value

      Lock.Type value
      Returns:
      the type of the lock
      Default:
      WRITE
    • time

      long time
      If it's not possible to acquire the lock in the given time a LockException is thrown.
      Returns:
      the wait time
      See Also:
      Default:
      -1L
    • unit

      TimeUnit unit
      Returns:
      the wait time unit
      Default:
      MILLISECONDS