Package org.apache.ivy.core.cache
Class ModuleDescriptorMemoryCache
- java.lang.Object
-
- org.apache.ivy.core.cache.ModuleDescriptorMemoryCache
-
class ModuleDescriptorMemoryCache extends java.lang.Object
Cache ModuleDescriptors so that when the same module is used twice (in multi-module build for instance), it is parsed only once. This cache is has a limited size, and keep the most recently used entries. The entry in the cache are invalidated if there is a change to one variable used in the module descriptor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ModuleDescriptorMemoryCache.CacheEntry
-
Field Summary
Fields Modifier and Type Field Description private int
maxSize
private java.util.LinkedHashMap<java.io.File,ModuleDescriptorMemoryCache.CacheEntry>
valueMap
-
Constructor Summary
Constructors Constructor Description ModuleDescriptorMemoryCache(int size)
Create a cache of the given size
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModuleDescriptor
get(java.io.File ivyFile, ParserSettings ivySettings, boolean validated, ModuleDescriptorProvider mdProvider)
(package private) ModuleDescriptor
getFromCache(java.io.File ivyFile, ParserSettings ivySettings, boolean validated)
ModuleDescriptor
getStale(java.io.File ivyFile, ParserSettings ivySettings, boolean validated, ModuleDescriptorProvider mdProvider)
Get the module descriptor from the mdProvider and store it into the cache.(package private) void
putInCache(java.io.File url, ParserSettingsMonitor ivySettingsMonitor, boolean validated, ModuleDescriptor descriptor)
-
-
-
Field Detail
-
maxSize
private final int maxSize
-
valueMap
private final java.util.LinkedHashMap<java.io.File,ModuleDescriptorMemoryCache.CacheEntry> valueMap
-
-
Method Detail
-
get
public ModuleDescriptor get(java.io.File ivyFile, ParserSettings ivySettings, boolean validated, ModuleDescriptorProvider mdProvider) throws java.text.ParseException, java.io.IOException
- Throws:
java.text.ParseException
java.io.IOException
-
getStale
public ModuleDescriptor getStale(java.io.File ivyFile, ParserSettings ivySettings, boolean validated, ModuleDescriptorProvider mdProvider) throws java.text.ParseException, java.io.IOException
Get the module descriptor from the mdProvider and store it into the cache.- Throws:
java.text.ParseException
java.io.IOException
-
getFromCache
ModuleDescriptor getFromCache(java.io.File ivyFile, ParserSettings ivySettings, boolean validated)
-
putInCache
void putInCache(java.io.File url, ParserSettingsMonitor ivySettingsMonitor, boolean validated, ModuleDescriptor descriptor)
-
-