mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
improve cache api
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.cache;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -73,42 +75,7 @@ public class EhCacheManager implements CacheManager
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public <K, V> ExtendedCache<K, V> getExtendedCache(Class<K> key,
|
||||
Class<V> value, String name)
|
||||
{
|
||||
return getCache(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
* @param name
|
||||
* @param <K>
|
||||
* @param <V>
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public <K, V> SimpleCache<K, V> getSimpleCache(Class<K> key, Class<V> value,
|
||||
String name)
|
||||
{
|
||||
return getCache(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param name
|
||||
* @param <K>
|
||||
* @param <V>
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private <K, V> EhCache<K, V> getCache(String name)
|
||||
public <K, V> Cache<K, V> getCache(Class<K> key, Class<V> value, String name)
|
||||
{
|
||||
return new EhCache<K, V>(cacheManager.getCache(name));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user