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

cn.sylinx.hbatis.plugin.cache.GuavaCachePlugin Maven / Gradle / Ivy

The newest version!
package cn.sylinx.hbatis.plugin.cache;

import cn.sylinx.hbatis.db.cache.CacheKitManager;
import cn.sylinx.hbatis.log.GLog;
import cn.sylinx.hbatis.plugin.IPlugin;

public class GuavaCachePlugin implements IPlugin {

	private GuavaCacheConfig guavaCacheConfig;

	public GuavaCachePlugin() {
		this(new GuavaCacheConfig());
	}

	public GuavaCachePlugin(GuavaCacheConfig guavaCacheConfig) {
		this.guavaCacheConfig = guavaCacheConfig;
	}

	@Override
	public boolean start(Object... objects) {

		GLog.info("guava cache plugin starting..");
		if (guavaCacheConfig == null) {
			guavaCacheConfig = new GuavaCacheConfig();
		}
		CacheKitManager.set(new GuavaCacheKit(guavaCacheConfig));
		GLog.info("guava cache plugin started");
		return true;
	}

	@Override
	public boolean stop() {
		return true;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy