Class Lock.Literal

java.lang.Object
jakarta.enterprise.util.AnnotationLiteral<Lock>
jakarta.enterprise.concurrent.Lock.Literal
All Implemented Interfaces:
Annotation
Enclosing class:
Lock

public static final class Lock.Literal extends jakarta.enterprise.util.AnnotationLiteral<Lock> implements Lock
Supports inline instantiation of the Lock annotation.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class jakarta.enterprise.concurrent.Lock

    Lock.Literal, Lock.Type
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Lock.Literal
    Instance of the Literal annotation.

    Fields inherited from interface jakarta.enterprise.concurrent.Lock

    IMMEDIATE, UNLIMITED
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the time to wait to obtain a lock.
    of(Lock.Type type, long accessTimeout, TimeUnit unit)
    Create a Lock annotation instance.
    Returns the Lock.Type to use.
    Returns units used for the specified accessTimeout value.

    Methods inherited from class jakarta.enterprise.util.AnnotationLiteral

    annotationType, equals, hashCode, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • INSTANCE

      public static final Lock.Literal INSTANCE
      Instance of the Literal annotation.
  • Method Details

    • of

      public static Lock.Literal of(Lock.Type type, long accessTimeout, TimeUnit unit)
      Create a Lock annotation instance.
      Parameters:
      type - whether to obtain the lock on the bean instance in exclusive or shared mode.
      accessTimeout - maximum amount of time to wait to obtain the lock.
      unit - units of the given accessTimeout value.
      Returns:
      Lock annotation instance.
    • type

      public Lock.Type type()
      Returns the Lock.Type to use.
      Returns:
      the Lock.Type to use
    • accessTimeout

      public long accessTimeout()
      Returns the time to wait to obtain a lock.
      Returns:
      the time to wait to obtain a lock
    • unit

      public TimeUnit unit()
      Returns units used for the specified accessTimeout value.
      Returns:
      units used for the specified accessTimeout value