added CacheConfigurationReader for GuavaCacheManager

This commit is contained in:
Sebastian Sdorra
2013-03-25 08:50:26 +01:00
parent c941ffb749
commit 3dfa6d4fc1
4 changed files with 435 additions and 37 deletions

View File

@@ -33,6 +33,7 @@ package sonia.scm.cache;
//~--- JDK imports ------------------------------------------------------------
import java.util.Collections;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
@@ -49,6 +50,28 @@ import javax.xml.bind.annotation.XmlRootElement;
public class CacheManagerConfiguration
{
/**
* Constructs ...
*
*/
public CacheManagerConfiguration() {}
/**
* Constructs ...
*
*
* @param defaultCache
* @param caches
*/
public CacheManagerConfiguration(CacheConfiguration defaultCache,
List<NamedCacheConfiguration> caches)
{
this.defaultCache = defaultCache;
this.caches = caches;
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
@@ -57,6 +80,9 @@ public class CacheManagerConfiguration
*/
public List<NamedCacheConfiguration> getCaches()
{
if ( caches == null ){
caches = Collections.EMPTY_LIST;
}
return caches;
}
@@ -78,6 +104,6 @@ public class CacheManagerConfiguration
private List<NamedCacheConfiguration> caches;
/** Field description */
@XmlElement(name = "cache")
@XmlElement(name = "defaultCache")
private CacheConfiguration defaultCache;
}