Package org.apache.maven.project
Class DefaultProjectRealmCache
- java.lang.Object
-
- org.apache.maven.project.DefaultProjectRealmCache
-
- All Implemented Interfaces:
ProjectRealmCache
,org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable
@Component(role=ProjectRealmCache.class) public class DefaultProjectRealmCache extends java.lang.Object implements ProjectRealmCache, org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable
Default project realm cache implementation. Assumes cached data does not change.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DefaultProjectRealmCache.CacheKey
CacheKey-
Nested classes/interfaces inherited from interface org.apache.maven.project.ProjectRealmCache
ProjectRealmCache.CacheRecord, ProjectRealmCache.Key
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<ProjectRealmCache.Key,ProjectRealmCache.CacheRecord>
cache
-
Constructor Summary
Constructors Constructor Description DefaultProjectRealmCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProjectRealmCache.Key
createKey(java.util.List<? extends org.codehaus.plexus.classworlds.realm.ClassRealm> extensionRealms)
void
dispose()
void
flush()
ProjectRealmCache.CacheRecord
get(ProjectRealmCache.Key key)
ProjectRealmCache.CacheRecord
put(ProjectRealmCache.Key key, org.codehaus.plexus.classworlds.realm.ClassRealm projectRealm, org.eclipse.aether.graph.DependencyFilter extensionArtifactFilter)
void
register(MavenProject project, ProjectRealmCache.Key key, ProjectRealmCache.CacheRecord record_)
Registers the specified cache record for usage with the given project.
-
-
-
Field Detail
-
cache
protected final java.util.Map<ProjectRealmCache.Key,ProjectRealmCache.CacheRecord> cache
-
-
Method Detail
-
createKey
public ProjectRealmCache.Key createKey(java.util.List<? extends org.codehaus.plexus.classworlds.realm.ClassRealm> extensionRealms)
- Specified by:
createKey
in interfaceProjectRealmCache
-
get
public ProjectRealmCache.CacheRecord get(ProjectRealmCache.Key key)
- Specified by:
get
in interfaceProjectRealmCache
-
put
public ProjectRealmCache.CacheRecord put(ProjectRealmCache.Key key, org.codehaus.plexus.classworlds.realm.ClassRealm projectRealm, org.eclipse.aether.graph.DependencyFilter extensionArtifactFilter)
- Specified by:
put
in interfaceProjectRealmCache
-
flush
public void flush()
- Specified by:
flush
in interfaceProjectRealmCache
-
register
public void register(MavenProject project, ProjectRealmCache.Key key, ProjectRealmCache.CacheRecord record_)
Description copied from interface:ProjectRealmCache
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 interfaceProjectRealmCache
- Parameters:
project
- The project that employs the plugin realm, must not benull
.record_
- The cache record being used for the project, must not benull
.
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable
-
-