public abstract class NamedLockSupport extends Object implements NamedLock
NamedLock implementations providing reference counting.| Constructor and Description |
|---|
NamedLockSupport(String name,
NamedLockFactorySupport factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the lock resource.
|
String |
name()
Returns this instance name, never null
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlockExclusively, lockShared, unlockpublic NamedLockSupport(String name, NamedLockFactorySupport factory)
public String name()
NamedLockpublic void close()
NamedLockNamedLock.unlock() in case any locking happened on it. After
invoking this method, the lock instance MUST NOT be used anymore. If lock for same name needed, a new instance
should be obtained from factory using NamedLockFactory.getLock(String). Ideally, instances are to be used
within try-with-resource blocks, so calling this method directly is not really needed, nor advised.close in interface AutoCloseableclose in interface NamedLockCopyright © 2010–2021 The Apache Software Foundation. All rights reserved.