Package org.apache.maven.plugin
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 java.lang.Object implements PluginRealmCache, org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable
Default PluginCache implementation. Assumes cached data does not change.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDefaultPluginRealmCache.CacheKeyCacheKey-
Nested classes/interfaces inherited from interface org.apache.maven.plugin.PluginRealmCache
PluginRealmCache.CacheRecord, PluginRealmCache.Key, PluginRealmCache.PluginRealmSupplier
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<PluginRealmCache.Key,PluginRealmCache.CacheRecord>cache
-
Constructor Summary
Constructors Constructor Description DefaultPluginRealmCache()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PluginRealmCache.KeycreateKey(org.apache.maven.model.Plugin plugin, java.lang.ClassLoader parentRealm, java.util.Map<java.lang.String,java.lang.ClassLoader> foreignImports, org.eclipse.aether.graph.DependencyFilter dependencyFilter, java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories, org.eclipse.aether.RepositorySystemSession session)voiddispose()voidflush()PluginRealmCache.CacheRecordget(PluginRealmCache.Key key)PluginRealmCache.CacheRecordget(PluginRealmCache.Key key, PluginRealmCache.PluginRealmSupplier supplier)protected static booleanpluginEquals(org.apache.maven.model.Plugin a, org.apache.maven.model.Plugin b)protected static intpluginHashCode(org.apache.maven.model.Plugin plugin)PluginRealmCache.CacheRecordput(PluginRealmCache.Key key, org.codehaus.plexus.classworlds.realm.ClassRealm pluginRealm, java.util.List<org.apache.maven.artifact.Artifact> pluginArtifacts)voidregister(MavenProject project, PluginRealmCache.Key key, PluginRealmCache.CacheRecord rcrd)Registers the specified cache record for usage with the given project.
-
-
-
Field Detail
-
cache
protected final java.util.Map<PluginRealmCache.Key,PluginRealmCache.CacheRecord> cache
-
-
Method Detail
-
createKey
public PluginRealmCache.Key createKey(org.apache.maven.model.Plugin plugin, java.lang.ClassLoader parentRealm, java.util.Map<java.lang.String,java.lang.ClassLoader> foreignImports, org.eclipse.aether.graph.DependencyFilter dependencyFilter, java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories, org.eclipse.aether.RepositorySystemSession session)
- Specified by:
createKeyin interfacePluginRealmCache
-
get
public PluginRealmCache.CacheRecord get(PluginRealmCache.Key key)
- Specified by:
getin interfacePluginRealmCache
-
get
public PluginRealmCache.CacheRecord get(PluginRealmCache.Key key, PluginRealmCache.PluginRealmSupplier supplier) throws PluginResolutionException, PluginContainerException
- Specified by:
getin interfacePluginRealmCache- Throws:
PluginResolutionExceptionPluginContainerException
-
put
public PluginRealmCache.CacheRecord put(PluginRealmCache.Key key, org.codehaus.plexus.classworlds.realm.ClassRealm pluginRealm, java.util.List<org.apache.maven.artifact.Artifact> pluginArtifacts)
- Specified by:
putin interfacePluginRealmCache
-
flush
public void flush()
- Specified by:
flushin interfacePluginRealmCache
-
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 rcrd)
Description copied from interface:PluginRealmCacheRegisters 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:
registerin interfacePluginRealmCache- Parameters:
project- The project that employs the plugin realm, must not benull.rcrd- The cache record being used for the project, must not benull.
-
dispose
public void dispose()
- Specified by:
disposein interfaceorg.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable
-
-