T- The generic type for the "name". This MUST implement hashCode() and equals() since the instances of this type will serve as keys in a
public class NamedLock<T> extends Object
Locks. A simple
Lockmanages access to a single resource. However, a
NamedLockmanages access to the members of a set of named resources. This is more efficient when the latency of the operation once the lock is acquired is significant, e.g., an RMI call or a disk IO.
The locks are stored in a
WeakHashMap so that they will be garbage
collected if there are no threads waiting in the queue for a given named
|Constructor and Description|
|Modifier and Type||Method and Description|
Return the canonical instance of the lock for a named resource.
name- The name.
Lockfor the named resource is available, then
Lockand return the locked
Copyright © 2006–2016 SYSTAP, LLC DBA Blazegraph. All rights reserved.