Package org.eclipse.aether.named.support
Class NamedLockSupport
- java.lang.Object
-
- org.eclipse.aether.named.support.NamedLockSupport
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,NamedLock
- Direct Known Subclasses:
AdaptedSemaphoreNamedLock
,FileLockNamedLock
,ReadWriteLockNamedLock
public abstract class NamedLockSupport extends java.lang.Object implements NamedLock
Support class forNamedLock
implementations providing reference counting.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description NamedLockSupport(java.lang.String name, NamedLockFactorySupport factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the lock resource.java.lang.String
name()
Returns this instance name, never null-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.aether.named.NamedLock
lockExclusively, lockShared, unlock
-
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
-
-
Constructor Detail
-
NamedLockSupport
public NamedLockSupport(java.lang.String name, NamedLockFactorySupport factory)
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:NamedLock
Returns this instance name, never null
-
close
public void close()
Description copied from interface:NamedLock
Closes the lock resource. Lock MUST be unlocked usingNamedLock.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 usingNamedLockFactory.getLock(String)
. Ideally, instances are to be used within try-with-resource blocks, so calling this method directly is not really needed, nor advised.
-
-