クラス CachingMetadataReaderFactory

java.lang.ObjectSE
org.springframework.core.type.classreading.CachingMetadataReaderFactory
実装されているすべてのインターフェース:
MetadataReaderFactory

public class CachingMetadataReaderFactory extends ObjectSE
MetadataReaderFactory インターフェースのキャッシング実装。Spring Resource ハンドルごとに(つまり、".class" ファイルごとに)MetadataReader インスタンスをキャッシングします。
導入:
2.5
作成者:
Juergen Hoeller, Costin Leau, Brian Clozel
  • フィールドのサマリー

    フィールド
    修飾子と型
    フィールド
    説明
    static final int
    ローカル MetadataReader キャッシュのデフォルトの最大エントリ数: 256。
  • コンストラクターの概要

    コンストラクター
    コンストラクター
    説明
    ローカルリソースキャッシュを使用して、デフォルトのクラスローダーの新しい CachingMetadataReaderFactory を作成します。
    ローカルリソースキャッシュを使用して、指定された ClassLoaderSE の新しい CachingMetadataReaderFactory を作成します。
    サポートされている場合は共有リソースキャッシュを、サポートされていない場合はローカルリソースキャッシュを使用して、指定された ResourceLoader の新しい CachingMetadataReaderFactory を作成します。
  • 方法の概要

    修飾子と型
    メソッド
    説明
    void
    ローカルの MetadataReader キャッシュがあればクリアし、キャッシュされたすべてのクラスメタデータを削除します。
    int
    MetadataReader キャッシュのエントリの最大数を返します。
    指定されたクラス名の MetadataReader を取得します。
    指定されたリソースの MetadataReader を取得します。
    この MetadataReaderFactory が構築された ResourceLoader を返します。
    void
    setCacheLimit(int cacheLimit)
    MetadataReader キャッシュの最大エントリ数を指定します。

    クラス ObjectSE から継承されたメソッド

    clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
  • フィールドの詳細

    • DEFAULT_CACHE_LIMIT

      public static final int DEFAULT_CACHE_LIMIT
      ローカル MetadataReader キャッシュのデフォルトの最大エントリ数: 256。
      関連事項:
  • コンストラクターの詳細

    • CachingMetadataReaderFactory

      public CachingMetadataReaderFactory()
      ローカルリソースキャッシュを使用して、デフォルトのクラスローダーの新しい CachingMetadataReaderFactory を作成します。
    • CachingMetadataReaderFactory

      public CachingMetadataReaderFactory(@Nullable ClassLoaderSE classLoader)
      ローカルリソースキャッシュを使用して、指定された ClassLoaderSE の新しい CachingMetadataReaderFactory を作成します。
      パラメーター:
      classLoader - 使用する ClassLoader
    • CachingMetadataReaderFactory

      public CachingMetadataReaderFactory(@Nullable ResourceLoader resourceLoader)
      サポートされている場合は共有リソースキャッシュを、サポートされていない場合はローカルリソースキャッシュを使用して、指定された ResourceLoader の新しい CachingMetadataReaderFactory を作成します。
      パラメーター:
      resourceLoader - 使用する Spring ResourceLoader (使用する ClassLoader も決定します)
      関連事項:
  • メソッドの詳細

    • setCacheLimit

      public void setCacheLimit(int cacheLimit)
      MetadataReader キャッシュの最大エントリ数を指定します。

      ローカルキャッシュのデフォルトは 256 ですが、共有キャッシュは通常無制限です。このメソッドは、ResourceLoader が共有リソースキャッシュをサポートしている場合でも、ローカルリソースキャッシュを適用します。

    • getCacheLimit

      public int getCacheLimit()
      MetadataReader キャッシュのエントリの最大数を返します。
    • getMetadataReader

      public MetadataReader getMetadataReader(Resource resource) throws IOExceptionSE
      インターフェースからコピーされた説明: MetadataReaderFactory
      指定されたリソースの MetadataReader を取得します。
      パラメーター:
      resource - リソース ( ".class" ファイルを指す)
      戻り値:
      ClassReader インスタンスのホルダー (非 null)
      例外:
      IOExceptionSE - I/O 障害の場合
    • clearCache

      public void clearCache()
      ローカルの MetadataReader キャッシュがあればクリアし、キャッシュされたすべてのクラスメタデータを削除します。
    • getResourceLoader

      public ResourceLoader getResourceLoader()
      この MetadataReaderFactory が構築された ResourceLoader を返します。
      次で指定:
      インターフェース MetadataReaderFactorygetResourceLoader 
    • getMetadataReader

      public MetadataReader getMetadataReader(StringSE className) throws IOExceptionSE
      インターフェースからコピーされた説明: MetadataReaderFactory
      指定されたクラス名の MetadataReader を取得します。
      次で指定:
      インターフェース MetadataReaderFactorygetMetadataReader 
      パラメーター:
      className - クラス名 ( ".class" ファイルに解決される)
      戻り値:
      ClassReader インスタンスのホルダー (非 null)
      例外:
      IOExceptionSE - I/O 障害の場合