create static read method for GuavaCacheConfigurationReader

This commit is contained in:
Sebastian Sdorra
2013-03-25 11:07:47 +01:00
parent 0ea4b43a58
commit f8bb0cf109
2 changed files with 71 additions and 50 deletions

View File

@@ -33,6 +33,7 @@ package sonia.scm.cache;
//~--- non-JDK imports --------------------------------------------------------
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Maps;
import com.google.inject.Singleton;
@@ -67,9 +68,18 @@ public class GuavaCacheManager implements CacheManager
*/
public GuavaCacheManager()
{
GuavaCacheConfigurationReader reader = new GuavaCacheConfigurationReader();
GuavaCacheManagerConfiguration config = reader.read();
this(GuavaCacheConfigurationReader.read());
}
/**
* Constructs ...
*
*
* @param config
*/
@VisibleForTesting
protected GuavaCacheManager(GuavaCacheManagerConfiguration config)
{
defaultConfiguration = config.getDefaultCache();
for (GuavaNamedCacheConfiguration ncc : config.getCaches())