クラス CachingMetadataReaderFactory
java.lang.ObjectSE
org.springframework.core.type.classreading.SimpleMetadataReaderFactory
org.springframework.core.type.classreading.CachingMetadataReaderFactory
- 実装されたすべてのインターフェース:
MetadataReaderFactory
MetadataReaderFactory
インターフェースのキャッシング実装。Spring Resource
ハンドルごとに(つまり、".class" ファイルごとに)MetadataReader
インスタンスをキャッシングします。- 導入:
- 2.5
- 作成者:
- Juergen Hoeller, Costin Leau
フィールドサマリー
コンストラクターのサマリー
コンストラクター説明ローカルリソースキャッシュを使用して、デフォルトのクラスローダーの新しい CachingMetadataReaderFactory を作成します。CachingMetadataReaderFactory
(ClassLoaderSE classLoader) ローカルリソースキャッシュを使用して、指定されたClassLoader
SE の新しい CachingMetadataReaderFactory を作成します。CachingMetadataReaderFactory
(ResourceLoader resourceLoader) サポートされている場合は共有リソースキャッシュを、サポートされていない場合はローカルリソースキャッシュを使用して、指定されたResourceLoader
の新しい CachingMetadataReaderFactory を作成します。メソッドのサマリー
修飾子と型メソッド説明void
ローカルの MetadataReader キャッシュがあればクリアし、キャッシュされたすべてのクラスメタデータを削除します。int
MetadataReader キャッシュのエントリの最大数を返します。getMetadataReader
(Resource resource) 指定されたリソースの MetadataReader を取得します。void
setCacheLimit
(int cacheLimit) MetadataReader キャッシュの最大エントリ数を指定します。クラス org.springframework.core.type.classreading.SimpleMetadataReaderFactory から継承されたメソッド
getMetadataReader, getResourceLoader
フィールドの詳細
DEFAULT_CACHE_LIMIT
public static final int DEFAULT_CACHE_LIMITローカル MetadataReader キャッシュのデフォルトの最大エントリ数: 256。- 関連事項:
コンストラクターの詳細
CachingMetadataReaderFactory
public CachingMetadataReaderFactory()ローカルリソースキャッシュを使用して、デフォルトのクラスローダーの新しい CachingMetadataReaderFactory を作成します。CachingMetadataReaderFactory
ローカルリソースキャッシュを使用して、指定されたClassLoader
SE の新しい 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 を取得します。- 次で指定:
- インターフェース
MetadataReaderFactory
のgetMetadataReader
- オーバーライド:
- クラス
SimpleMetadataReaderFactory
のgetMetadataReader
- パラメーター:
resource
- リソース ( ".class" ファイルを指す)- 戻り値:
- ClassReader インスタンスのホルダー (非
null
) - 例外:
ClassFormatException
- 互換性のないクラス形式の場合IOExceptionSE
- I/O 障害の場合
clearCache
public void clearCache()ローカルの MetadataReader キャッシュがあればクリアし、キャッシュされたすべてのクラスメタデータを削除します。