
com.github.bingoohuang.springrediscache.RefreshSecondsProcessor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-redis-cache Show documentation
Show all versions of spring-redis-cache Show documentation
spring cache based on redis
The newest version!
package com.github.bingoohuang.springrediscache;
class RefreshSecondsProcessor implements CacheProcessor {
private final InvocationRuntime runtime;
RefreshSecondsProcessor(InvocationRuntime runtime) {
this.runtime = runtime;
}
@Override
public Object process() {
Object value = runtime.getLocalCache();
if (value != null) return value;
try {
runtime.waitCacheLock();
// check again
value = runtime.getLocalCache();
if (value != null) return value;
return runtime.invokeMethodAndPutCache();
} finally {
runtime.unlockLocalCache();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy