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

com.holmos.cache.store.impl.AbstractCacheStore Maven / Gradle / Ivy

The newest version!
package com.holmos.cache.store.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.holmos.cache.config.CacheConfigComponent;
import com.holmos.cache.outpolicy.CacheOutPolicy;
import com.holmos.cache.size.layout.MemoryLayoutSpecification;
import com.holmos.cache.size.layout.impl.Hotspot32MemoryLayoutSpecification;
import com.holmos.cache.size.layout.impl.Hotspot64MemoryLayoutSpecification;
import com.holmos.cache.status.CacheStatus;
import com.holmos.cache.store.CacheStore;


/**
 * 所有存储器的抽象父类
 * 
 * @author: 吴银龙([email protected])
 * @version: 2013-3-21 下午12:47:17 
 */

public abstract class AbstractCacheStore implements CacheStore{
	
	Logger logger = LoggerFactory.getLogger(this.getClass());
	
	CacheConfigComponent configComponent = null;
	
	CacheStatus cacheStatus;
	
	CacheOutPolicy outPolicy;
	
	public AbstractCacheStore(CacheConfigComponent configComponent){
		this.setConfigComponent(configComponent);
	}

	public CacheConfigComponent getConfigComponent() {
		return configComponent;
	}

	public void setConfigComponent(CacheConfigComponent configComponent) {
		this.configComponent = configComponent;
	}
	
	public static MemoryLayoutSpecification createMemoryLayoutSpecification(int jdk_bit){
		switch (jdk_bit) {
		case 32:
			return new Hotspot32MemoryLayoutSpecification();
		case 64:
			return new Hotspot64MemoryLayoutSpecification();
		default:
			return null;
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy