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(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(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 IOException
getMetadataReader in interface org.springframework.core.type.classreading.MetadataReaderFactorygetMetadataReader in class org.springframework.core.type.classreading.SimpleMetadataReaderFactoryIOExceptionprotected org.springframework.core.type.classreading.MetadataReader createMetadataReader(org.springframework.core.io.Resource resource)
throws IOException
resource - the source resource.IOException - on errorpublic void clearCache()
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.