Class NamedLockFactoryAdapter.AdaptedLockSyncContext
java.lang.Object
org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapter.AdaptedLockSyncContext
- All Implemented Interfaces:
Closeable
,AutoCloseable
,SyncContext
- Enclosing class:
NamedLockFactoryAdapter
private static class NamedLockFactoryAdapter.AdaptedLockSyncContext
extends Object
implements SyncContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NameMapper
private static final org.slf4j.Logger
private final NamedLockFactory
private final int
private final long
private final RepositorySystemSession
private final boolean
private final long
private final TimeUnit
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
AdaptedLockSyncContext
(RepositorySystemSession session, boolean shared, NameMapper lockNaming, NamedLockFactory namedLockFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
acquire
(Collection<? extends Artifact> artifacts, Collection<? extends Metadata> metadatas) Acquires synchronized access to the specified artifacts and metadatas.void
close()
Releases all previously acquired artifacts/metadatas.private void
closeAll()
private int
getRetry
(RepositorySystemSession session) private long
getRetryWait
(RepositorySystemSession session) private long
getTime
(RepositorySystemSession session) private TimeUnit
getTimeUnit
(RepositorySystemSession session)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
session
-
lockNaming
-
namedLockFactory
-
time
private final long time -
timeUnit
-
retry
private final int retry -
retryWait
private final long retryWait -
locks
-
-
Constructor Details
-
AdaptedLockSyncContext
private AdaptedLockSyncContext(RepositorySystemSession session, boolean shared, NameMapper lockNaming, NamedLockFactory namedLockFactory)
-
-
Method Details
-
getTime
-
getTimeUnit
-
getRetry
-
getRetryWait
-
acquire
public void acquire(Collection<? extends Artifact> artifacts, Collection<? extends Metadata> metadatas) Description copied from interface:SyncContext
Acquires 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:
acquire
in interfaceSyncContext
- Parameters:
artifacts
- The artifacts to acquire, may benull
or empty if none.metadatas
- The metadatas to acquire, may benull
or empty if none.
-
closeAll
private void closeAll() -
close
public void close()Description copied from interface:SyncContext
Releases 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceSyncContext
-