public class ConcurrentReferenceCachingMetadataReaderFactory
extends org.springframework.core.type.classreading.SimpleMetadataReaderFactory
MetadataReaderFactory interface backed by a
ConcurrentReferenceHashMap, caching MetadataReader per Spring
Resource handle (i.e. per ".class" file).CachingMetadataReaderFactory| Constructor and Description |
|---|
ConcurrentReferenceCachingMetadataReaderFactory()
Create a new
ConcurrentReferenceCachingMetadataReaderFactory instance for
the default class loader. |
ConcurrentReferenceCachingMetadataReaderFactory(java.lang.ClassLoader classLoader)
Create a new
ConcurrentReferenceCachingMetadataReaderFactory instance for
the given class loader. |
ConcurrentReferenceCachingMetadataReaderFactory(org.springframework.core.io.ResourceLoader resourceLoader)
Create a new
ConcurrentReferenceCachingMetadataReaderFactory instance for
the given resource loader. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Clear the entire MetadataReader cache, removing all cached class metadata.
|
protected org.springframework.core.type.classreading.MetadataReader |
createMetadataReader(org.springframework.core.io.Resource resource)
Create the meta-data reader.
|
org.springframework.core.type.classreading.MetadataReader |
getMetadataReader(org.springframework.core.io.Resource resource) |
public ConcurrentReferenceCachingMetadataReaderFactory()
ConcurrentReferenceCachingMetadataReaderFactory instance for
the default class loader.public ConcurrentReferenceCachingMetadataReaderFactory(org.springframework.core.io.ResourceLoader resourceLoader)
ConcurrentReferenceCachingMetadataReaderFactory instance for
the given resource loader.resourceLoader - the Spring ResourceLoader to use (also determines the
ClassLoader to use)public ConcurrentReferenceCachingMetadataReaderFactory(java.lang.ClassLoader classLoader)
ConcurrentReferenceCachingMetadataReaderFactory instance for
the given class loader.classLoader - the ClassLoader to usepublic org.springframework.core.type.classreading.MetadataReader getMetadataReader(org.springframework.core.io.Resource resource)
throws java.io.IOException
getMetadataReader in interface org.springframework.core.type.classreading.MetadataReaderFactorygetMetadataReader in class org.springframework.core.type.classreading.SimpleMetadataReaderFactoryjava.io.IOExceptionprotected org.springframework.core.type.classreading.MetadataReader createMetadataReader(org.springframework.core.io.Resource resource)
throws java.io.IOException
resource - the source resource.java.io.IOException - on errorpublic void clearCache()