java.util.concurrent.locks.ReentrantLock that can be used when
we need to be dealing with a dictionary of lockable objects wherein we traditionally would have
used the synchronized keyword.
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public KeyAwareAutoCloseableLock. |
| internalMap | back to summary |
|---|---|
| private final Map<Object, AutoCloseableLock> internalMap | |
| KeyAwareAutoCloseableLock | back to summary |
|---|---|
| public KeyAwareAutoCloseableLock() | |
| lockForObject | back to summary |
|---|---|
| public KeyAwareAutoCloseableLock. | |
| Modifier and Type | Field and Description |
|---|---|
| private final Runnable | |
| private final AutoCloseableLock |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements java. |
| public boolean | equals(Object
the reference object with which to compare. object)Overrides java. |
| public int |
| cleanupAction | back to summary |
|---|---|
| private final Runnable cleanupAction | |
| lock | back to summary |
|---|---|
| private final AutoCloseableLock lock | |
| AutoReleasable | back to summary |
|---|---|
| pack-priv AutoReleasable(AutoCloseableLock lock, Runnable cleanupAction) | |
| close | back to summary |
|---|---|
| public void close() Implements java. Doc from java. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |