Class MojoExecutionScope

java.lang.Object
org.apache.maven.impl.di.MojoExecutionScope
All Implemented Interfaces:
Scope
Direct Known Subclasses:
MojoExecutionScope

public class MojoExecutionScope extends Object implements Scope
MojoExecutionScope
  • Constructor Details

    • MojoExecutionScope

      public MojoExecutionScope()
  • Method Details

    • seededKeySupplier

      public static <T> Supplier<T> seededKeySupplier(Class<? extends T> clazz)
    • enter

      public void enter()
    • getScopeState

      protected MojoExecutionScope.ScopeState getScopeState()
    • exit

      public void exit()
    • seed

      public <T> void seed(Class<T> clazz, Supplier<T> value)
    • seed

      public <T> void seed(Class<T> clazz, T value)
    • scope

      @Nonnull public <T> Supplier<T> scope(@Nonnull Key<T> key, @Nonnull Supplier<T> unscoped)
      Description copied from interface: Scope
      Scopes a supplier of instances.

      This method wraps an unscoped instance supplier with scope-specific logic that controls when new instances are created versus when existing instances are reused.

      Specified by:
      scope in interface Scope
      Type Parameters:
      T - the type of instance being scoped
      Parameters:
      key - the key identifying the instance type
      unscoped - the original unscoped instance supplier
      Returns:
      a scoped supplier that implements the scope's caching strategy