Package nl.vpro.util.locker
Class ObjectLocker.LockHolder<K>
- java.lang.Object
-
- nl.vpro.util.locker.ObjectLocker.LockHolder<K>
-
- Enclosing class:
- ObjectLocker
public static class ObjectLocker.LockHolder<K> extends Object
Most importantly this is a wrapper aroundReentrantLock
, but it stores some extra meta information, like the original key, thread, and initialization time.It can also store the exception if that happened during the hold of the lock.
-
-
Field Summary
Fields Modifier and Type Field Description K
key
ReentrantLock
lock
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disable(boolean interrupt)
boolean
equals(Object o)
Duration
getAge()
Duration
getWarnTime()
int
hashCode()
boolean
isDisabled()
void
setWarnTime(Duration warnTime)
String
summarize()
String
summarize(boolean showThreadBusy)
String
toString()
-
-
-
Field Detail
-
key
public final K key
-
lock
public final ReentrantLock lock
-
-
Method Detail
-
getAge
public Duration getAge()
- Since:
- 5.13
-
summarize
public String summarize()
-
summarize
public String summarize(boolean showThreadBusy)
-
disable
public void disable(boolean interrupt)
-
isDisabled
public boolean isDisabled()
-
getWarnTime
public Duration getWarnTime()
-
setWarnTime
public void setWarnTime(Duration warnTime)
-
-