Class NamedLockFactoryAdapter.AdaptedLockSyncContext
- java.lang.Object
-
- org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapter.AdaptedLockSyncContext
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,SyncContext
- Enclosing class:
- NamedLockFactoryAdapter
private static class NamedLockFactoryAdapter.AdaptedLockSyncContext extends java.lang.Object implements SyncContext
-
-
Field Summary
Fields Modifier and Type Field Description private NameMapperlockNamingprivate java.util.Deque<NamedLock>locksprivate static org.slf4j.LoggerLOGGERprivate NamedLockFactorynamedLockFactoryprivate RepositorySystemSessionsessionprivate booleansharedprivate longtimeprivate java.util.concurrent.TimeUnittimeUnit
-
Constructor Summary
Constructors Modifier Constructor Description privateAdaptedLockSyncContext(RepositorySystemSession session, boolean shared, NameMapper lockNaming, NamedLockFactory namedLockFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacquire(java.util.Collection<? extends Artifact> artifacts, java.util.Collection<? extends Metadata> metadatas)Acquires synchronized access to the specified artifacts and metadatas.voidclose()Releases all previously acquired artifacts/metadatas.private longgetTime(RepositorySystemSession session)private java.util.concurrent.TimeUnitgetTimeUnit(RepositorySystemSession session)
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
session
private final RepositorySystemSession session
-
shared
private final boolean shared
-
lockNaming
private final NameMapper lockNaming
-
namedLockFactory
private final NamedLockFactory namedLockFactory
-
time
private final long time
-
timeUnit
private final java.util.concurrent.TimeUnit timeUnit
-
locks
private final java.util.Deque<NamedLock> locks
-
-
Constructor Detail
-
AdaptedLockSyncContext
private AdaptedLockSyncContext(RepositorySystemSession session, boolean shared, NameMapper lockNaming, NamedLockFactory namedLockFactory)
-
-
Method Detail
-
getTime
private long getTime(RepositorySystemSession session)
-
getTimeUnit
private java.util.concurrent.TimeUnit getTimeUnit(RepositorySystemSession session)
-
acquire
public void acquire(java.util.Collection<? extends Artifact> artifacts, java.util.Collection<? extends Metadata> metadatas)
Description copied from interface:SyncContextAcquires synchronized access to the specified artifacts and metadatas. The invocation will potentially block until all requested resources can be acquired by the calling thread. Acquiring resources that are already acquired by this synchronization context has no effect. Please also see the class-level documentation for information regarding reentrancy. The method may be invoked multiple times on a synchronization context until all desired resources have been acquired.- Specified by:
acquirein interfaceSyncContext- Parameters:
artifacts- The artifacts to acquire, may benullor empty if none.metadatas- The metadatas to acquire, may benullor empty if none.
-
close
public void close()
Description copied from interface:SyncContextReleases all previously acquired artifacts/metadatas. If no resources have been acquired before or if this synchronization context has already been closed, this method does nothing.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceSyncContext
-
-