2017-02-15 3 views
1

これで春ブートソースコード:キャッシュ一つだけのキャッシュの春ブーツguavaCacheManager cacheNameを指定-キャッシュ

/** 
* Create a native Guava Cache instance for the specified cache name. 
* @param name the name of the cache 
* @return the native Guava Cache instance 
*/ 
protected com.google.common.cache.Cache<Object, Object> createNativeGuavaCache(String name) { 
    if (this.cacheLoader != null) { 
     return this.cacheBuilder.build(this.cacheLoader); 
    } 
    else { 
     return this.cacheBuilder.build(); 
    } 
} 

すべての名前 がどのように私は2つの異なるキャッシュを作成するのですか?

+0

申し訳ありませんが、私の問題は次のとおりです。期限切れキャッシュと無期限チャーチを作成したい –

答えて

0

正確には何が問題なのかよく分かりませんが、getCache(String)メソッドを使用してキャッシュを作成してください。あなたは好きなだけ多くを作ることができます。