cn.sylinx.hbatis.db.cache.CacheKitManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hbatis-core Show documentation
Show all versions of hbatis-core Show documentation
hbatis is a simple orm framework
The newest version!
package cn.sylinx.hbatis.db.cache;
public final class CacheKitManager {
private static ICacheKit cacheKit = new NoCache();
public static ICacheKit get() {
synchronized (CacheKitManager.class) {
return cacheKit;
}
}
public static void set(ICacheKit cacheKit) {
synchronized (CacheKitManager.class) {
if (cacheKit != null && cacheKit.isInited()) {
CacheKitManager.cacheKit = cacheKit;
}
}
}
private static final class NoCache implements ICacheKit {
@Override
public boolean isInited() {
return false;
}
@Override
public T get(String cacheKey, IDataLoader dataLoader) {
return null;
}
}
}