Class GlobalSyncContextFactory.GlobalSyncContext

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, SyncContext
    Enclosing class:
    GlobalSyncContextFactory

    static class GlobalSyncContextFactory.GlobalSyncContext
    extends java.lang.Object
    implements SyncContext
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.locks.Lock lock  
      private int lockHoldCount  
      private static org.slf4j.Logger LOGGER  
      private boolean shared  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private GlobalSyncContext​(java.util.concurrent.locks.Lock lock, boolean shared)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void acquire​(java.util.Collection<? extends Artifact> artifact, java.util.Collection<? extends Metadata> metadata)
      Acquires synchronized access to the specified artifacts and metadatas.
      void close()
      Releases all previously acquired artifacts/metadatas.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • lock

        private final java.util.concurrent.locks.Lock lock
      • shared

        private final boolean shared
      • lockHoldCount

        private int lockHoldCount
    • Constructor Detail

      • GlobalSyncContext

        private GlobalSyncContext​(java.util.concurrent.locks.Lock lock,
                                  boolean shared)
    • Method Detail

      • acquire

        public void acquire​(java.util.Collection<? extends Artifact> artifact,
                            java.util.Collection<? extends Metadata> metadata)
        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 interface SyncContext
        Parameters:
        artifact - The artifacts to acquire, may be null or empty if none.
        metadata - The metadatas to acquire, may be null or empty if none.
      • 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 interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface SyncContext