org.apache.maven.plugin
Class DefaultPluginRealmCache

java.lang.Object
  extended by org.apache.maven.plugin.DefaultPluginRealmCache
All Implemented Interfaces:
PluginRealmCache

@Component(role=PluginRealmCache.class)
public class DefaultPluginRealmCache
extends Object
implements PluginRealmCache

Default PluginCache implementation. Assumes cached data does not change.


Nested Class Summary
protected static class DefaultPluginRealmCache.CacheKey
           
 
Nested classes/interfaces inherited from interface org.apache.maven.plugin.PluginRealmCache
PluginRealmCache.CacheRecord, PluginRealmCache.Key
 
Field Summary
protected  Map<PluginRealmCache.Key,PluginRealmCache.CacheRecord> cache
           
 
Constructor Summary
DefaultPluginRealmCache()
           
 
Method Summary
 PluginRealmCache.Key createKey(Plugin plugin, ClassLoader parentRealm, Map<String,ClassLoader> foreignImports, DependencyFilter dependencyFilter, List<RemoteRepository> repositories, RepositorySystemSession session)
           
 void flush()
           
 PluginRealmCache.CacheRecord get(PluginRealmCache.Key key)
           
protected static boolean pluginEquals(Plugin a, Plugin b)
           
protected static int pluginHashCode(Plugin plugin)
           
 PluginRealmCache.CacheRecord put(PluginRealmCache.Key key, ClassRealm pluginRealm, List<Artifact> pluginArtifacts)
           
 void register(MavenProject project, PluginRealmCache.CacheRecord record)
          Registers the specified cache record for usage with the given project.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected final Map<PluginRealmCache.Key,PluginRealmCache.CacheRecord> cache
Constructor Detail

DefaultPluginRealmCache

public DefaultPluginRealmCache()
Method Detail

createKey

public PluginRealmCache.Key createKey(Plugin plugin,
                                      ClassLoader parentRealm,
                                      Map<String,ClassLoader> foreignImports,
                                      DependencyFilter dependencyFilter,
                                      List<RemoteRepository> repositories,
                                      RepositorySystemSession session)
Specified by:
createKey in interface PluginRealmCache

get

public PluginRealmCache.CacheRecord get(PluginRealmCache.Key key)
Specified by:
get in interface PluginRealmCache

put

public PluginRealmCache.CacheRecord put(PluginRealmCache.Key key,
                                        ClassRealm pluginRealm,
                                        List<Artifact> pluginArtifacts)
Specified by:
put in interface PluginRealmCache

flush

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

pluginHashCode

protected static int pluginHashCode(Plugin plugin)

pluginEquals

protected static boolean pluginEquals(Plugin a,
                                      Plugin b)

register

public void register(MavenProject project,
                     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.


Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.