Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -35,6 +35,7 @@ import org.springframework.util.Assert;
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 4.3
|
||||
* @see CaffeineCacheManager
|
||||
*/
|
||||
public class CaffeineCache extends AbstractValueAdaptingCache {
|
||||
|
||||
@@ -159,10 +160,10 @@ public class CaffeineCache extends AbstractValueAdaptingCache {
|
||||
@Override
|
||||
public Object apply(Object o) {
|
||||
try {
|
||||
return toStoreValue(valueLoader.call());
|
||||
return toStoreValue(this.valueLoader.call());
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new ValueRetrievalException(o, valueLoader, ex);
|
||||
throw new ValueRetrievalException(o, this.valueLoader, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -34,6 +34,7 @@ import org.springframework.util.Assert;
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.1
|
||||
* @see EhCacheCacheManager
|
||||
*/
|
||||
public class EhCacheCache implements Cache {
|
||||
|
||||
@@ -95,7 +96,6 @@ public class EhCacheCache implements Cache {
|
||||
this.cache.releaseWriteLockOnKey(key);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private <T> T loadValue(Object key, Callable<T> valueLoader) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -34,6 +34,7 @@ import org.springframework.util.Assert;
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.1
|
||||
* @see EhCacheCache
|
||||
*/
|
||||
public class EhCacheCacheManager extends AbstractTransactionSupportingCacheManager {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -28,13 +28,14 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* {@link org.springframework.cache.Cache} implementation on top of a
|
||||
* {@link javax.cache.Cache} instance.
|
||||
* {@link Cache javax.cache.Cache} instance.
|
||||
*
|
||||
* <p>Note: This class has been updated for JCache 1.0, as of Spring 4.0.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.2
|
||||
* @see JCacheCacheManager
|
||||
*/
|
||||
public class JCacheCache extends AbstractValueAdaptingCache {
|
||||
|
||||
@@ -42,7 +43,7 @@ public class JCacheCache extends AbstractValueAdaptingCache {
|
||||
|
||||
|
||||
/**
|
||||
* Create an {@link org.springframework.cache.jcache.JCacheCache} instance.
|
||||
* Create a {@code JCacheCache} instance.
|
||||
* @param jcache backing JCache Cache instance
|
||||
*/
|
||||
public JCacheCache(Cache<Object, Object> jcache) {
|
||||
@@ -50,7 +51,7 @@ public class JCacheCache extends AbstractValueAdaptingCache {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an {@link org.springframework.cache.jcache.JCacheCache} instance.
|
||||
* Create a {@code JCacheCache} instance.
|
||||
* @param jcache backing JCache Cache instance
|
||||
* @param allowNullValues whether to accept and convert null values for this cache
|
||||
*/
|
||||
@@ -128,7 +129,7 @@ public class JCacheCache extends AbstractValueAdaptingCache {
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new EntryProcessorException("Value loader '" + valueLoader + "' failed " +
|
||||
"to compute value for key '" + entry.getKey() + "'", ex);
|
||||
"to compute value for key '" + entry.getKey() + "'", ex);
|
||||
}
|
||||
entry.setValue(toStoreValue(value));
|
||||
return value;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -28,13 +28,14 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* {@link org.springframework.cache.CacheManager} implementation
|
||||
* backed by a JCache {@link javax.cache.CacheManager}.
|
||||
* backed by a JCache {@link CacheManager javax.cache.CacheManager}.
|
||||
*
|
||||
* <p>Note: This class has been updated for JCache 1.0, as of Spring 4.0.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.2
|
||||
* @see JCacheCache
|
||||
*/
|
||||
public class JCacheCacheManager extends AbstractTransactionSupportingCacheManager {
|
||||
|
||||
@@ -45,15 +46,18 @@ public class JCacheCacheManager extends AbstractTransactionSupportingCacheManage
|
||||
|
||||
|
||||
/**
|
||||
* Create a new JCacheCacheManager, setting the target JCache CacheManager
|
||||
* through the {@link #setCacheManager} bean property.
|
||||
* Create a new {@code JCacheCacheManager} without a backing JCache
|
||||
* {@link CacheManager javax.cache.CacheManager}.
|
||||
* <p>The backing JCache {@code javax.cache.CacheManager} can be set via the
|
||||
* {@link #setCacheManager} bean property.
|
||||
*/
|
||||
public JCacheCacheManager() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new JCacheCacheManager for the given backing JCache.
|
||||
* @param cacheManager the backing JCache {@link javax.cache.CacheManager}
|
||||
* Create a new {@code JCacheCacheManager} for the given backing JCache
|
||||
* {@link CacheManager javax.cache.CacheManager}.
|
||||
* @param cacheManager the backing JCache {@code javax.cache.CacheManager}
|
||||
*/
|
||||
public JCacheCacheManager(CacheManager cacheManager) {
|
||||
this.cacheManager = cacheManager;
|
||||
@@ -61,14 +65,14 @@ public class JCacheCacheManager extends AbstractTransactionSupportingCacheManage
|
||||
|
||||
|
||||
/**
|
||||
* Set the backing JCache {@link javax.cache.CacheManager}.
|
||||
* Set the backing JCache {@link CacheManager javax.cache.CacheManager}.
|
||||
*/
|
||||
public void setCacheManager(@Nullable CacheManager cacheManager) {
|
||||
this.cacheManager = cacheManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the backing JCache {@link javax.cache.CacheManager}.
|
||||
* Return the backing JCache {@link CacheManager javax.cache.CacheManager}.
|
||||
*/
|
||||
@Nullable
|
||||
public CacheManager getCacheManager() {
|
||||
|
||||
Reference in New Issue
Block a user