Package org.apache.ivy.core.cache
Class ModuleDescriptorMemoryCache
java.lang.Object
org.apache.ivy.core.cache.ModuleDescriptorMemoryCache
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final LinkedHashMap<File,
ModuleDescriptorMemoryCache.CacheEntry> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget
(File ivyFile, ParserSettings ivySettings, boolean validated, ModuleDescriptorProvider mdProvider) (package private) ModuleDescriptor
getFromCache
(File ivyFile, ParserSettings ivySettings, boolean validated) getStale
(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
(File url, ParserSettingsMonitor ivySettingsMonitor, boolean validated, ModuleDescriptor descriptor)
-
Field Details
-
maxSize
private final int maxSize -
valueMap
-
-
Constructor Details
-
ModuleDescriptorMemoryCache
public ModuleDescriptorMemoryCache(int size) Create a cache of the given size- Parameters:
size
- int
-
-
Method Details
-
get
public ModuleDescriptor get(File ivyFile, ParserSettings ivySettings, boolean validated, ModuleDescriptorProvider mdProvider) throws ParseException, IOException - Throws:
ParseException
IOException
-
getStale
public ModuleDescriptor getStale(File ivyFile, ParserSettings ivySettings, boolean validated, ModuleDescriptorProvider mdProvider) throws ParseException, IOException Get the module descriptor from the mdProvider and store it into the cache.- Throws:
ParseException
IOException
-
getFromCache
-
putInCache
void putInCache(File url, ParserSettingsMonitor ivySettingsMonitor, boolean validated, ModuleDescriptor descriptor)
-