public abstract class EhCacheManagerUtils
extends java.lang.Object
CacheManager
セットアップ用の便利なビルダーメソッド。Spring が提供するリソースからのプログラムによるブートストラップを簡単に提供します。これは主に、Spring 構成クラスの @Bean
メソッド内での使用を目的としています。 これらの方法は、カスタム CacheManager
セットアップコードの簡単な代替手段です。高度な目的のために、parseConfiguration(org.springframework.core.io.Resource)
を使用し、構成オブジェクトをカスタマイズしてから、CacheManager.CacheManager(Configuration)
コンストラクターを呼び出すことを検討してください。
コンストラクターと説明 |
---|
EhCacheManagerUtils() |
修飾子と型 | メソッドと説明 |
---|---|
static CacheManager | buildCacheManager() デフォルト構成から EhCache CacheManager をビルドします。 |
static CacheManager | buildCacheManager(Resource configLocation) 指定された構成リソースから EhCache CacheManager を構築します。 |
static CacheManager | buildCacheManager(java.lang.String name) デフォルト構成から EhCache CacheManager をビルドします。 |
static CacheManager | buildCacheManager(java.lang.String name, Resource configLocation) 指定された構成リソースから EhCache CacheManager を構築します。 |
static Configuration | parseConfiguration(Resource configLocation) カスタム CacheManager 作成でさらに使用するために、指定されたリソースから EhCache 構成を解析します。 |
public static CacheManager buildCacheManager() throws CacheException
CacheManager
をビルドします。CacheManager は、クラスパスのルートにある "ehcache.xml" から構成されます(つまり、デフォルトの EhCache 初期化(EhCache ドキュメントで定義されている)が適用されます)。構成ファイルが見つからない場合は、フェイルセーフフォールバック構成が使用されます。
CacheException
- 構成の解析に失敗した場合 public static CacheManager buildCacheManager(java.lang.String name) throws CacheException
CacheManager
をビルドします。CacheManager は、クラスパスのルートにある "ehcache.xml" から構成されます(つまり、デフォルトの EhCache 初期化(EhCache ドキュメントで定義されている)が適用されます)。構成ファイルが見つからない場合は、フェイルセーフフォールバック構成が使用されます。
name
- キャッシュマネージャーの目的の名前 CacheException
- 構成の解析に失敗した場合 public static CacheManager buildCacheManager(Resource configLocation) throws CacheException
CacheManager
を構築します。configLocation
- 構成ファイルの場所 (Spring リソースとして)CacheException
- 構成の解析に失敗した場合 public static CacheManager buildCacheManager(java.lang.String name, Resource configLocation) throws CacheException
CacheManager
を構築します。name
- キャッシュマネージャーの目的の名前 configLocation
- 構成ファイルの場所 (Spring リソースとして)CacheException
- 構成の解析に失敗した場合 public static Configuration parseConfiguration(Resource configLocation) throws CacheException
CacheManager
作成でさらに使用するために、指定されたリソースから EhCache 構成を解析します。configLocation
- 構成ファイルの場所 (Spring リソースとして)CacheException
- 構成の解析に失敗した場合 CacheManager.CacheManager(Configuration)
, CacheManager.create(Configuration)