Class MojoExecutor.ProjectLock

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Enclosing class:
    MojoExecutor

    private static class MojoExecutor.ProjectLock
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Aggregating mojo executions (possibly) modify all MavenProjects, including those that are currently in use by concurrently running mojo executions. To prevent race conditions, an aggregating execution will block all other executions until finished. We also lock on a given project to forbid a forked lifecycle to be executed concurrently with the project. TODO: ideally, the builder should take care of the ordering in a smarter way TODO: and concurrency issues fixed with MNG-7157
    • Constructor Summary

      Constructors 
      Constructor Description
      ProjectLock​(MavenSession session, MojoDescriptor mojoDescriptor, java.util.concurrent.locks.ReadWriteLock aggregatorLock)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      private java.util.concurrent.locks.Lock getProjectLock​(MavenSession session)  
      • Methods inherited from class java.lang.Object

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

      • acquiredAggregatorLock

        final java.util.concurrent.locks.Lock acquiredAggregatorLock
      • acquiredProjectLock

        final java.util.concurrent.locks.Lock acquiredProjectLock
    • Constructor Detail

      • ProjectLock

        ProjectLock​(MavenSession session,
                    MojoDescriptor mojoDescriptor,
                    java.util.concurrent.locks.ReadWriteLock aggregatorLock)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • getProjectLock

        private java.util.concurrent.locks.Lock getProjectLock​(MavenSession session)