Merge remote-tracking branch 'origin/3.1.x'

This commit is contained in:
Olga Maciaszek-Sharma
2023-01-17 14:00:36 +01:00
3 changed files with 10 additions and 0 deletions

View File

@@ -31,20 +31,24 @@ public class StandardScopeCache implements ScopeCache {
private final ConcurrentMap<String, Object> cache = new ConcurrentHashMap<>();
@Override
public Object remove(String name) {
return this.cache.remove(name);
}
@Override
public Collection<Object> clear() {
Collection<Object> values = new ArrayList<>(this.cache.values());
this.cache.clear();
return values;
}
@Override
public Object get(String name) {
return this.cache.get(name);
}
@Override
public Object put(String name, Object value) {
Object result = this.cache.putIfAbsent(name, value);
if (result != null) {

View File

@@ -31,10 +31,12 @@ public class ThreadLocalScopeCache implements ScopeCache {
private ThreadLocal<ConcurrentMap<String, Object>> data = ThreadLocal.withInitial(ConcurrentHashMap::new);
@Override
public Object remove(String name) {
return this.data.get().remove(name);
}
@Override
public Collection<Object> clear() {
ConcurrentMap<String, Object> map = this.data.get();
Collection<Object> values = new ArrayList<>(map.values());
@@ -42,10 +44,12 @@ public class ThreadLocalScopeCache implements ScopeCache {
return values;
}
@Override
public Object get(String name) {
return this.data.get().get(name);
}
@Override
public Object put(String name, Object value) {
Object result = this.data.get().putIfAbsent(name, value);
if (result != null) {

View File

@@ -42,6 +42,7 @@ public class LoadBalancerClientSpecification implements NamedContextFactory.Spec
this.configuration = configuration;
}
@Override
public String getName() {
return this.name;
}
@@ -51,6 +52,7 @@ public class LoadBalancerClientSpecification implements NamedContextFactory.Spec
this.name = name;
}
@Override
public Class<?>[] getConfiguration() {
return this.configuration;
}