Polish caching components

master
Juergen Hoeller 12 years ago committed by Chris Beams
parent 7ea85a959c
commit 54f82cd540
  1. 6
      spring-context/src/main/java/org/springframework/cache/annotation/package-info.java
  2. 7
      spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCache.java
  3. 4
      spring-context/src/main/java/org/springframework/cache/concurrent/package-info.java
  4. 10
      spring-context/src/main/java/org/springframework/cache/ehcache/EhCacheCache.java
  5. 16
      spring-context/src/main/java/org/springframework/cache/ehcache/EhCacheCacheManager.java
  6. 8
      spring-context/src/main/java/org/springframework/cache/ehcache/package-info.java

@ -1,8 +1,6 @@
/**
* Annotations and supporting classes for declarative cache management.
* Hooked into Spring's caching interception infrastructure
* via {@link org.springframework.cache.interceptor.CacheOperationSource
* CacheOperationSource} implementation.
* Hooked into Spring's cache interception infrastructure via
* {@link org.springframework.cache.interceptor.CacheOperationSource}.
*/
package org.springframework.cache.annotation;

@ -16,13 +16,13 @@
package org.springframework.cache.concurrent;
import org.springframework.cache.Cache;
import org.springframework.cache.support.SimpleValueWrapper;
import java.io.Serializable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.springframework.cache.Cache;
import org.springframework.cache.support.SimpleValueWrapper;
/**
* Simple {@link Cache} implementation based on the core JDK
* {@code java.util.concurrent} package.
@ -62,6 +62,7 @@ public class ConcurrentMapCache implements Cache {
/**
* Create a new ConcurrentMapCache with the specified name.
* @param name the name of the cache
* @param allowNullValues whether to accept and convert null values for this cache
*/
public ConcurrentMapCache(String name, boolean allowNullValues) {
this(name, new ConcurrentHashMap<Object, Object>(), allowNullValues);

@ -1,9 +1,7 @@
/**
* Implementation package for {@code java.util.concurrent} based caches.
* Provides a {@link org.springframework.cache.CacheManager CacheManager}
* and {@link org.springframework.cache.Cache Cache} implementation for
* use in a Spring context.
* use in a Spring context, using a JDK based thread pool at runtime.
*/
package org.springframework.cache.concurrent;

@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -57,10 +57,6 @@ public class EhCacheCache implements Cache {
return this.cache;
}
public void clear() {
this.cache.removeAll();
}
public ValueWrapper get(Object key) {
Element element = this.cache.get(key);
return (element != null ? new SimpleValueWrapper(element.getObjectValue()) : null);
@ -74,4 +70,8 @@ public class EhCacheCache implements Cache {
this.cache.remove(key);
}
public void clear() {
this.cache.removeAll();
}
}

@ -39,18 +39,17 @@ public class EhCacheCacheManager extends AbstractCacheManager {
/**
* Returns the backing EhCache {@link net.sf.ehcache.CacheManager}.
* @return the backing EhCache {@link net.sf.ehcache.CacheManager}.
* Set the backing EhCache {@link net.sf.ehcache.CacheManager}.
*/
public net.sf.ehcache.CacheManager getCacheManager() {
return cacheManager;
public void setCacheManager(net.sf.ehcache.CacheManager cacheManager) {
this.cacheManager = cacheManager;
}
/**
* Sets the backing EhCache {@link net.sf.ehcache.CacheManager}.
* Return the backing EhCache {@link net.sf.ehcache.CacheManager}.
*/
public void setCacheManager(net.sf.ehcache.CacheManager cacheManager) {
this.cacheManager = cacheManager;
public net.sf.ehcache.CacheManager getCacheManager() {
return this.cacheManager;
}
@ -83,4 +82,5 @@ public class EhCacheCacheManager extends AbstractCacheManager {
}
return cache;
}
}
}

@ -1,11 +1,7 @@
/**
*
* Support classes for the open source cache
* <a href="http://ehcache.sourceforge.net">Ehcache</a>,
* allowing to set up an EHCache CacheManager and Caches
* <a href="http://ehcache.sourceforge.net">EhCache</a>,
* allowing to set up an EhCache CacheManager and Caches
* as beans in a Spring context.
*
*/
package org.springframework.cache.ehcache;

Loading…
Cancel
Save