All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.sylinx.hbatis.db.cache.CacheKitManager Maven / Gradle / Ivy

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;
		}

	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy