Class DefaultSyncContextFactory

All Implemented Interfaces:
Service, SyncContextFactory

@Singleton @Named public final class DefaultSyncContextFactory extends Object implements SyncContextFactory, Service
Default SyncContextFactory implementation that uses named locks.

The implementation relies fully on NamedLockFactoryAdapterFactory and all it does is just "stuff" the adapter instance into session, hence factory is called only when given session has no instance created.

  • Constructor Details

  • Method Details

    • initService

      public void initService(ServiceLocator locator)
      Description copied from interface: Service
      Provides the opportunity to initialize this service and to acquire other services for its operation from the locator. A service must not save the reference to the provided service locator.
      Specified by:
      initService in interface Service
      locator - The service locator, must not be null.
    • newInstance

      public SyncContext newInstance(RepositorySystemSession session, boolean shared)
      Description copied from interface: SyncContextFactory
      Creates a new synchronization context.
      Specified by:
      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.
      The synchronization context, never null.
      See Also: