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, wait
lockExclusively, lockShared, unlock
public NamedLockSupport(String name, NamedLockFactorySupport factory)
public String name()
NamedLock
public void close()
NamedLock
NamedLock.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 AutoCloseable
close
in interface NamedLock
Copyright © 2010–2021 The Apache Software Foundation. All rights reserved.