Skip to content
Snippets Groups Projects

Add proxyMode to CacheScope and remove obselete destructionCallback

2 files
+ 9
5
Compare changes
  • Side-by-side
  • Inline

Files

@@ -36,9 +36,6 @@ import org.springframework.web.context.request.RequestContextHolder;
public class CacheManager extends AbstractRequestAttributesScope {
private Map<String, Object> scopedObjects = Collections.synchronizedMap(new HashMap<String, Object>());
private Map<String, Runnable> destructionCallbacks = Collections
.synchronizedMap(new HashMap<String, Runnable>());
@Override
public Object get(String name, ObjectFactory<?> objectFactory) {
if (RequestContextHolder.getRequestAttributes() != null) {
@@ -53,7 +50,6 @@ public class CacheManager extends AbstractRequestAttributesScope {
if (RequestContextHolder.getRequestAttributes() != null) {
return super.remove(name);
}
destructionCallbacks.remove(name);
return scopedObjects.remove(name);
}
@@ -62,7 +58,6 @@ public class CacheManager extends AbstractRequestAttributesScope {
if (RequestContextHolder.getRequestAttributes() != null) {
super.registerDestructionCallback(name, callback);
}
destructionCallbacks.put(name, callback);
}
@Override
Loading