クラス CachingMetadataReaderFactory
java.lang.ObjectSE
org.springframework.core.type.classreading.CachingMetadataReaderFactory
- 実装されているすべてのインターフェース:
MetadataReaderFactory
MetadataReaderFactory インターフェースのキャッシング実装。Spring Resource ハンドルごとに(つまり、".class" ファイルごとに)MetadataReader インスタンスをキャッシングします。- 導入:
- 2.5
- 作成者:
- Juergen Hoeller, Costin Leau, Brian Clozel
フィールドのサマリー
フィールドコンストラクターの概要
コンストラクターコンストラクター説明ローカルリソースキャッシュを使用して、デフォルトのクラスローダーの新しい CachingMetadataReaderFactory を作成します。CachingMetadataReaderFactory(@Nullable ClassLoaderSE classLoader) ローカルリソースキャッシュを使用して、指定されたClassLoaderSE の新しい CachingMetadataReaderFactory を作成します。CachingMetadataReaderFactory(@Nullable ResourceLoader resourceLoader) サポートされている場合は共有リソースキャッシュを、サポートされていない場合はローカルリソースキャッシュを使用して、指定されたResourceLoaderの新しい CachingMetadataReaderFactory を作成します。方法の概要
修飾子と型メソッド説明voidローカルの MetadataReader キャッシュがあればクリアし、キャッシュされたすべてのクラスメタデータを削除します。intMetadataReader キャッシュのエントリの最大数を返します。getMetadataReader(StringSE className) 指定されたクラス名の MetadataReader を取得します。getMetadataReader(Resource resource) 指定されたリソースの MetadataReader を取得します。この MetadataReaderFactory が構築された ResourceLoader を返します。voidsetCacheLimit(int cacheLimit) MetadataReader キャッシュの最大エントリ数を指定します。
フィールドの詳細
DEFAULT_CACHE_LIMIT
public static final int DEFAULT_CACHE_LIMITローカル MetadataReader キャッシュのデフォルトの最大エントリ数: 256。- 関連事項:
コンストラクターの詳細
CachingMetadataReaderFactory
public CachingMetadataReaderFactory()ローカルリソースキャッシュを使用して、デフォルトのクラスローダーの新しい CachingMetadataReaderFactory を作成します。CachingMetadataReaderFactory
ローカルリソースキャッシュを使用して、指定されたClassLoaderSE の新しい CachingMetadataReaderFactory を作成します。- パラメーター:
classLoader- 使用する ClassLoader
CachingMetadataReaderFactory
サポートされている場合は共有リソースキャッシュを、サポートされていない場合はローカルリソースキャッシュを使用して、指定されたResourceLoaderの新しい CachingMetadataReaderFactory を作成します。- パラメーター:
resourceLoader- 使用する Spring ResourceLoader (使用する ClassLoader も決定します)- 関連事項:
メソッドの詳細
setCacheLimit
public void setCacheLimit(int cacheLimit) MetadataReader キャッシュの最大エントリ数を指定します。ローカルキャッシュのデフォルトは 256 ですが、共有キャッシュは通常無制限です。このメソッドは、
ResourceLoaderが共有リソースキャッシュをサポートしている場合でも、ローカルリソースキャッシュを適用します。getCacheLimit
public int getCacheLimit()MetadataReader キャッシュのエントリの最大数を返します。getMetadataReader
インターフェースからコピーされた説明:MetadataReaderFactory指定されたリソースの MetadataReader を取得します。- パラメーター:
resource- リソース ( ".class" ファイルを指す)- 戻り値:
- ClassReader インスタンスのホルダー (非
null) - 例外:
IOExceptionSE- I/O 障害の場合
clearCache
public void clearCache()ローカルの MetadataReader キャッシュがあればクリアし、キャッシュされたすべてのクラスメタデータを削除します。getResourceLoader
この MetadataReaderFactory が構築された ResourceLoader を返します。- 次で指定:
- インターフェース
MetadataReaderFactoryのgetResourceLoader
getMetadataReader
インターフェースからコピーされた説明:MetadataReaderFactory指定されたクラス名の MetadataReader を取得します。- 次で指定:
- インターフェース
MetadataReaderFactoryのgetMetadataReader - パラメーター:
className- クラス名 ( ".class" ファイルに解決される)- 戻り値:
- ClassReader インスタンスのホルダー (非
null) - 例外:
IOExceptionSE- I/O 障害の場合