CachedFactory

This commit is contained in:
redkale
2023-12-09 11:00:53 +08:00
parent 86cfeafd8d
commit c2f66b61ec
2 changed files with 21 additions and 0 deletions

View File

@@ -72,4 +72,11 @@ public @interface Cached {
*/
TimeUnit timeUnit() default TimeUnit.SECONDS;
/**
* 是否可以缓存null值
*
* @return 是否可以缓存null
*/
boolean nullable() default false;
}

View File

@@ -3,6 +3,9 @@
*/
package org.redkale.cacheing;
import org.redkale.source.CacheMemorySource;
import org.redkale.source.CacheSource;
/**
* @TODO 待实现
*
@@ -10,4 +13,15 @@ package org.redkale.cacheing;
*/
public class CachedFactory {
protected CacheSource localSource = new CacheMemorySource("cacheing");
protected CacheSource remoteSource;
protected CachedFactory(CacheSource remoteSource) {
this.remoteSource = remoteSource;
}
public static CachedFactory create(CacheSource remoteSource) {
return new CachedFactory(remoteSource);
}
}