@Singleton @Named public final class DefaultSyncContextFactory extends Object implements SyncContextFactory, Service
SyncContextFactory
implementation that uses named locks.Constructor and Description |
---|
DefaultSyncContextFactory() |
DefaultSyncContextFactory(NamedLockFactorySelector selector)
Constructor used with DI, where factories are injected and selected based on key.
|
Modifier and Type | Method and Description |
---|---|
void |
initService(ServiceLocator locator)
Provides the opportunity to initialize this service and to acquire other services for its operation from the
locator.
|
SyncContext |
newInstance(RepositorySystemSession session,
boolean shared)
Creates a new synchronization context.
|
void |
shutdown() |
@Inject public DefaultSyncContextFactory(NamedLockFactorySelector selector)
public DefaultSyncContextFactory()
public void initService(ServiceLocator locator)
Service
initService
in interface Service
locator
- The service locator, must not be null
.public SyncContext newInstance(RepositorySystemSession session, boolean shared)
SyncContextFactory
newInstance
in interface SyncContextFactory
session
- The repository session during which the context will be used, must not be null
.shared
- A flag indicating whether access to the artifacts/metadata associated with the new context can be
shared among concurrent readers or whether access needs to be exclusive to the calling thread.null
.RepositorySystem.newSyncContext(RepositorySystemSession, boolean)
@PreDestroy public void shutdown()
Copyright © 2010–2022 The Apache Software Foundation. All rights reserved.