Browse Source
- removed AbstractDelegatingCache (a cache is not a map, no need to offer a template) + renamed ConcurrentCache to ConcurrentCacheMap git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4325 50f2f4bb-b051-0410-bef5-90022cba6387pull/1/merge
5 changed files with 72 additions and 124 deletions
@ -1,23 +1,29 @@
@@ -1,23 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>org.springframework.context</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
<buildCommand> |
||||
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
<buildCommand> |
||||
<name>org.springframework.ide.eclipse.core.springbuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
</buildSpec> |
||||
<natures> |
||||
<nature>org.springframework.ide.eclipse.core.springnature</nature> |
||||
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
</natures> |
||||
</projectDescription> |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>org.springframework.context</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
<buildCommand> |
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
<buildCommand> |
||||
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
<buildCommand> |
||||
<name>org.springframework.ide.eclipse.core.springbuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
</buildSpec> |
||||
<natures> |
||||
<nature>org.springframework.ide.eclipse.core.springnature</nature> |
||||
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> |
||||
</natures> |
||||
</projectDescription> |
||||
|
||||
@ -1,57 +0,0 @@
@@ -1,57 +0,0 @@
|
||||
/* |
||||
* Copyright 2010-2011 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. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.cache.concurrent; |
||||
|
||||
import java.util.concurrent.ConcurrentHashMap; |
||||
import java.util.concurrent.ConcurrentMap; |
||||
|
||||
import org.springframework.cache.Cache; |
||||
import org.springframework.cache.support.AbstractDelegatingCache; |
||||
|
||||
/** |
||||
* Simple {@link Cache} implementation based on the JDK 1.5+ |
||||
* java.util.concurrent package. Useful for testing or simple caching scenarios. |
||||
* |
||||
* @author Costin Leau |
||||
*/ |
||||
public class ConcurrentCache<K, V> extends AbstractDelegatingCache<K, V> { |
||||
|
||||
private final ConcurrentMap<K, V> store; |
||||
private final String name; |
||||
|
||||
public ConcurrentCache() { |
||||
this(""); |
||||
} |
||||
|
||||
public ConcurrentCache(String name) { |
||||
this(new ConcurrentHashMap<K, V>(), name); |
||||
} |
||||
|
||||
public ConcurrentCache(ConcurrentMap<K, V> delegate, String name) { |
||||
super(delegate, true); |
||||
this.store = delegate; |
||||
this.name = name; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public ConcurrentMap<K, V> getNativeCache() { |
||||
return store; |
||||
} |
||||
} |
||||
Loading…
Reference in new issue