public class CachingMetadataReaderFactory extends SimpleMetadataReaderFactory
MetadataReaderFactory
インターフェースのキャッシング実装。Spring Resource
ハンドルごとに(つまり、".class" ファイルごとに)MetadataReader
インスタンスをキャッシングします。修飾子と型 | フィールドと説明 |
---|---|
static int | DEFAULT_CACHE_LIMIT ローカル MetadataReader キャッシュのデフォルトの最大エントリ数: 256。 |
コンストラクターと説明 |
---|
CachingMetadataReaderFactory() ローカルリソースキャッシュを使用して、デフォルトのクラスローダーの新しい CachingMetadataReaderFactory を作成します。 |
CachingMetadataReaderFactory(ClassLoaderSE classLoader) ローカルリソースキャッシュを使用して、指定された ClassLoader SE の新しい CachingMetadataReaderFactory を作成します。 |
CachingMetadataReaderFactory(ResourceLoader resourceLoader) サポートされている場合は共有リソースキャッシュを、サポートされていない場合はローカルリソースキャッシュを使用して、指定された ResourceLoader の新しい CachingMetadataReaderFactory を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
void | clearCache() ローカルの MetadataReader キャッシュがあればクリアし、キャッシュされたすべてのクラスメタデータを削除します。 |
int | getCacheLimit() MetadataReader キャッシュのエントリの最大数を返します。 |
MetadataReader | getMetadataReader(Resource resource) 指定されたリソースの MetadataReader を取得します。 |
void | setCacheLimit(int cacheLimit) MetadataReader キャッシュの最大エントリ数を指定します。 |
getMetadataReader, getResourceLoader
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public static final int DEFAULT_CACHE_LIMIT
public CachingMetadataReaderFactory()
public CachingMetadataReaderFactory(@Nullable ClassLoaderSE classLoader)
ClassLoader
SE の新しい CachingMetadataReaderFactory を作成します。classLoader
- 使用する ClassLoaderpublic CachingMetadataReaderFactory(@Nullable ResourceLoader resourceLoader)
ResourceLoader
の新しい CachingMetadataReaderFactory を作成します。resourceLoader
- 使用する Spring ResourceLoader (使用する ClassLoader も決定します)DefaultResourceLoader.getResourceCache(java.lang.Class<T>)
public void setCacheLimit(int cacheLimit)
ローカルキャッシュのデフォルトは 256 ですが、共有キャッシュは通常無制限です。このメソッドは、ResourceLoader
が共有リソースキャッシュをサポートしている場合でも、ローカルリソースキャッシュを適用します。
public int getCacheLimit()
public MetadataReader getMetadataReader(Resource resource) throws IOExceptionSE
MetadataReaderFactory
MetadataReaderFactory
の getMetadataReader
SimpleMetadataReaderFactory
の getMetadataReader
resource
- リソース ( ".class" ファイルを指す)null
)IOExceptionSE
- I/O 障害の場合 public void clearCache()