Class DefaultPluginRealmCache

java.lang.Object
org.apache.maven.plugin.DefaultPluginRealmCache
All Implemented Interfaces:
PluginRealmCache, org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable

@Component(role=PluginRealmCache.class) public class DefaultPluginRealmCache extends Object implements PluginRealmCache, org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable
Default PluginCache implementation. Assumes cached data does not change.
  • Field Details

  • Constructor Details

    • DefaultPluginRealmCache

      public DefaultPluginRealmCache()
  • Method Details

    • createKey

      public PluginRealmCache.Key createKey(org.apache.maven.model.Plugin plugin, ClassLoader parentRealm, Map<String,ClassLoader> foreignImports, org.eclipse.aether.graph.DependencyFilter dependencyFilter, List<org.eclipse.aether.repository.RemoteRepository> repositories, org.eclipse.aether.RepositorySystemSession session)
      Specified by:
      createKey in interface PluginRealmCache
    • get

      Specified by:
      get in interface PluginRealmCache
    • put

      public PluginRealmCache.CacheRecord put(PluginRealmCache.Key key, org.codehaus.plexus.classworlds.realm.ClassRealm pluginRealm, List<org.apache.maven.artifact.Artifact> pluginArtifacts)
      Specified by:
      put in interface PluginRealmCache
    • flush

      public void flush()
      Specified by:
      flush in interface PluginRealmCache
    • pluginHashCode

      protected static int pluginHashCode(org.apache.maven.model.Plugin plugin)
    • pluginEquals

      protected static boolean pluginEquals(org.apache.maven.model.Plugin a, org.apache.maven.model.Plugin b)
    • register

      public void register(MavenProject project, PluginRealmCache.Key key, PluginRealmCache.CacheRecord record_)
      Description copied from interface: PluginRealmCache
      Registers the specified cache record for usage with the given project. Integrators can use the information collected from this method in combination with a custom cache implementation to dispose unused records from the cache.
      Specified by:
      register in interface PluginRealmCache
      Parameters:
      project - The project that employs the plugin realm, must not be null.
      record_ - The cache record being used for the project, must not be null.
    • dispose

      public void dispose()
      Specified by:
      dispose in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable