Class LockAttempt


  • public class LockAttempt
    extends java.lang.Object
    Information about a lock.

    Should be mutated by a single thread, except fillStackTrace() which can be invoked by any threads. Other threads may see an inconsistent state of this instance.

    Author:
    hakon
    • Method Detail

      • invokingAcquire

        public static LockAttempt invokingAcquire​(ThreadLockStats threadLockStats,
                                                  java.lang.String lockPath,
                                                  java.time.Duration timeout,
                                                  LockMetrics lockMetrics,
                                                  boolean reentry)
      • getThreadName

        public java.lang.String getThreadName()
      • getLockPath

        public java.lang.String getLockPath()
      • getTimeAcquiredWasInvoked

        public java.time.Instant getTimeAcquiredWasInvoked()
      • getAcquireTimeout

        public java.time.Duration getAcquireTimeout()
      • getReentry

        public boolean getReentry()
      • getTimeLockWasAcquired

        public java.util.Optional<java.time.Instant> getTimeLockWasAcquired()
      • isAcquiring

        public boolean isAcquiring()
      • getTimeAcquireEndedOrNow

        public java.time.Instant getTimeAcquireEndedOrNow()
      • getTimeTerminalStateWasReached

        public java.util.Optional<java.time.Instant> getTimeTerminalStateWasReached()
      • getStackTrace

        public java.util.Optional<java.lang.String> getStackTrace()
      • getNestedLockAttempts

        public java.util.List<LockAttempt> getNestedLockAttempts()
      • getDurationOfAcquire

        public java.time.Duration getDurationOfAcquire()
      • getDurationWithLock

        public java.time.Duration getDurationWithLock()
      • getDuration

        public java.time.Duration getDuration()
      • getStableTotalDuration

        public java.time.Duration getStableTotalDuration()
        Get time from just before trying to acquire lock to the time the terminal state was reached, or ZERO.
      • fillStackTrace

        public void fillStackTrace()
        Fill in the stack trace starting at the caller's stack frame.