Package org.apache.maven.plugin
Class DefaultExtensionRealmCache
- java.lang.Object
-
- org.apache.maven.plugin.DefaultExtensionRealmCache
-
- All Implemented Interfaces:
ExtensionRealmCache
,org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable
@Component(role=ExtensionRealmCache.class) public class DefaultExtensionRealmCache extends Object implements ExtensionRealmCache, org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable
Default extension realm cache implementation. Assumes cached data does not change.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DefaultExtensionRealmCache.CacheKey
CacheKey-
Nested classes/interfaces inherited from interface org.apache.maven.plugin.ExtensionRealmCache
ExtensionRealmCache.CacheRecord, ExtensionRealmCache.Key
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<ExtensionRealmCache.Key,ExtensionRealmCache.CacheRecord>
cache
-
Constructor Summary
Constructors Constructor Description DefaultExtensionRealmCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtensionRealmCache.Key
createKey(List<Artifact> extensionArtifacts)
void
dispose()
void
flush()
ExtensionRealmCache.CacheRecord
get(ExtensionRealmCache.Key key)
ExtensionRealmCache.CacheRecord
put(ExtensionRealmCache.Key key, org.codehaus.plexus.classworlds.realm.ClassRealm extensionRealm, ExtensionDescriptor extensionDescriptor, List<Artifact> artifacts)
void
register(MavenProject project, ExtensionRealmCache.Key key, ExtensionRealmCache.CacheRecord record)
Registers the specified cache record for usage with the given project.
-
-
-
Field Detail
-
cache
protected final Map<ExtensionRealmCache.Key,ExtensionRealmCache.CacheRecord> cache
-
-
Method Detail
-
createKey
public ExtensionRealmCache.Key createKey(List<Artifact> extensionArtifacts)
- Specified by:
createKey
in interfaceExtensionRealmCache
-
get
public ExtensionRealmCache.CacheRecord get(ExtensionRealmCache.Key key)
- Specified by:
get
in interfaceExtensionRealmCache
-
put
public ExtensionRealmCache.CacheRecord put(ExtensionRealmCache.Key key, org.codehaus.plexus.classworlds.realm.ClassRealm extensionRealm, ExtensionDescriptor extensionDescriptor, List<Artifact> artifacts)
- Specified by:
put
in interfaceExtensionRealmCache
-
flush
public void flush()
- Specified by:
flush
in interfaceExtensionRealmCache
-
register
public void register(MavenProject project, ExtensionRealmCache.Key key, ExtensionRealmCache.CacheRecord record)
Description copied from interface:ExtensionRealmCache
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 interfaceExtensionRealmCache
- 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
-
-