类 ConcurrentReferenceCachingMetadataReaderFactory
- java.lang.Object
- org.springframework.core.type.classreading.SimpleMetadataReaderFactory
- org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory
- 所有已实现的接口:
org.springframework.core.type.classreading.MetadataReaderFactory
public class ConcurrentReferenceCachingMetadataReaderFactory extends org.springframework.core.type.classreading.SimpleMetadataReaderFactory
Caching implementation of theMetadataReaderFactory
interface backed by aConcurrentReferenceHashMap
, cachingMetadataReader
per SpringResource
handle (i.e. per ".class" file).- 从以下版本开始:
- 1.4.0
- 另请参阅:
CachingMetadataReaderFactory
构造器概要
构造器 构造器 说明 ConcurrentReferenceCachingMetadataReaderFactory()
Create a newConcurrentReferenceCachingMetadataReaderFactory
instance for the default class loader.ConcurrentReferenceCachingMetadataReaderFactory(ClassLoader classLoader)
Create a newConcurrentReferenceCachingMetadataReaderFactory
instance for the given class loader.ConcurrentReferenceCachingMetadataReaderFactory(org.springframework.core.io.ResourceLoader resourceLoader)
Create a newConcurrentReferenceCachingMetadataReaderFactory
instance for the given resource loader.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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)
构造器详细资料
ConcurrentReferenceCachingMetadataReaderFactory
public ConcurrentReferenceCachingMetadataReaderFactory()
Create a newConcurrentReferenceCachingMetadataReaderFactory
instance for the default class loader.
ConcurrentReferenceCachingMetadataReaderFactory
public ConcurrentReferenceCachingMetadataReaderFactory(org.springframework.core.io.ResourceLoader resourceLoader)
Create a newConcurrentReferenceCachingMetadataReaderFactory
instance for the given resource loader.- 参数:
resourceLoader
- the Spring ResourceLoader to use (also determines the ClassLoader to use)
ConcurrentReferenceCachingMetadataReaderFactory
public ConcurrentReferenceCachingMetadataReaderFactory(ClassLoader classLoader)
Create a newConcurrentReferenceCachingMetadataReaderFactory
instance for the given class loader.- 参数:
classLoader
- the ClassLoader to use
方法详细资料
getMetadataReader
public org.springframework.core.type.classreading.MetadataReader getMetadataReader(org.springframework.core.io.Resource resource) throws IOException
- 指定者:
getMetadataReader
在接口中org.springframework.core.type.classreading.MetadataReaderFactory
- 覆盖:
getMetadataReader
在类中org.springframework.core.type.classreading.SimpleMetadataReaderFactory
- 抛出:
IOException
createMetadataReader
protected org.springframework.core.type.classreading.MetadataReader createMetadataReader(org.springframework.core.io.Resource resource) throws IOException
Create the meta-data reader.- 参数:
resource
- the source resource.- 返回:
- the meta-data reader
- 抛出:
IOException
- on error
clearCache
public void clearCache()
Clear the entire MetadataReader cache, removing all cached class metadata.