当前位置: 首页>>代码示例>>Java>>正文


Java JCS类代码示例

本文整理汇总了Java中org.apache.jcs.JCS的典型用法代码示例。如果您正苦于以下问题:Java JCS类的具体用法?Java JCS怎么用?Java JCS使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JCS类属于org.apache.jcs包,在下文中一共展示了JCS类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: JCSCache

import org.apache.jcs.JCS; //导入依赖的package包/类
public JCSCache(String regionName, java.util.Properties properties) throws CacheException {
	
	try {
		region = JCS.getInstance(regionName);
	}
	catch (org.apache.jcs.access.exception.CacheException e) {
		log.error("could not create JCS region", e);
		throw new CacheException(e);
	}
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:JCSCache.java

示例2: DataSourceFactory

import org.apache.jcs.JCS; //导入依赖的package包/类
public DataSourceFactory(Collection<DataSource> sources, boolean caching) {
	_sources = sources;
	_caching = caching;
	if (_caching) {
		try {
			_cache = JCS.getInstance("s2sCache");
		} catch (CacheException e) {
			log.error("Unable to setup JCS cache; caching not enabled.", e);
			_caching = false;
		}
	}
}
 
开发者ID:tetherless-world,项目名称:s2s,代码行数:13,代码来源:DataSourceFactory.java

示例3: InterfaceFactory

import org.apache.jcs.JCS; //导入依赖的package包/类
public InterfaceFactory(Collection<DataSource> sources, boolean caching) {
	_sources = sources;
	_caching = caching;
	if (_caching) {
		try {
			_cache = JCS.getInstance("s2sCache");
		} catch (CacheException e) {
			log.error("Unable to setup JCS cache; caching not enabled.", e);
			_caching = false;
		}
	}
}
 
开发者ID:tetherless-world,项目名称:s2s,代码行数:13,代码来源:InterfaceFactory.java

示例4: InputFactory

import org.apache.jcs.JCS; //导入依赖的package包/类
public InputFactory( Collection<DataSource> sources, boolean caching) {
	_sources = sources;
	_caching = caching;
	if (_caching) {
		try {
			_cache = JCS.getInstance("s2sCache");
		} catch (CacheException e) {
			log.error("Unable to setup JCS cache; caching not enabled.", e);
			_caching = false;
		}
	}
}
 
开发者ID:tetherless-world,项目名称:s2s,代码行数:13,代码来源:InputFactory.java

示例5: SearchServiceFactory

import org.apache.jcs.JCS; //导入依赖的package包/类
public SearchServiceFactory(Collection<DataSource> sources, boolean caching) {
	_sources = sources;
	_caching = caching;
	if (_caching) {
		try {
			_cache = JCS.getInstance("s2sCache");
		} catch (CacheException e) {
			log.error("Unable to setup JCS cache; caching not enabled.", e);
			_caching = false;
		}
	}
}
 
开发者ID:tetherless-world,项目名称:s2s,代码行数:13,代码来源:SearchServiceFactory.java

示例6: WidgetFactory

import org.apache.jcs.JCS; //导入依赖的package包/类
public WidgetFactory(Collection<DataSource> sources, boolean caching) {
	_sources = sources;
	_caching = caching;
	if (_caching) {
		try {
			_cache = JCS.getInstance("s2sCache");
		} catch (CacheException e) {
			log.error("Unable to setup JCS cache; caching not enabled.", e);
			_caching = false;
		}
	}
}
 
开发者ID:tetherless-world,项目名称:s2s,代码行数:13,代码来源:WidgetFactory.java

示例7: FacetCollectionFactory

import org.apache.jcs.JCS; //导入依赖的package包/类
public FacetCollectionFactory(Collection<DataSource> sources, boolean caching) {
	_sources = sources;
	_caching = caching;
	if (_caching) {
		try {
			_cache = JCS.getInstance("s2sCache");
		} catch (CacheException e) {
			log.error("Unable to setup JCS cache; caching not enabled.", e);
			_caching = false;
		}
	}
}
 
开发者ID:tetherless-world,项目名称:s2s,代码行数:13,代码来源:FacetCollectionFactory.java

示例8: ObjectCacheJCSImpl

import org.apache.jcs.JCS; //导入依赖的package包/类
/**
 * Constructor used by the {@link ObjectCacheJCSPerClassImpl}
 */
public ObjectCacheJCSImpl(String name)
{
    regionName = (name != null ? name : DEFAULT_REGION);
    try
    {
        jcsCache = JCS.getInstance(regionName);
    }
    catch(Exception e)
    {
        throw new RuntimeCacheException("Can't instantiate JCS ObjectCacheImplementation", e);
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:16,代码来源:ObjectCacheJCSImpl.java

示例9: JCSCache

import org.apache.jcs.JCS; //导入依赖的package包/类
public JCSCache() {
	try {
		cache = JCS.getInstance("OUR_REGION");
	} catch (CacheException e) {
		e.printStackTrace();
	}
}
 
开发者ID:davy-zhang,项目名称:CodeForBlog,代码行数:8,代码来源:JCSCache.java

示例10: run

import org.apache.jcs.JCS; //导入依赖的package包/类
/** Run the shutdown hook for disposing of all caches. */
@Override 
public void run() {
	for (String cacheName : cacheNames) {
		try {
              logger.info("Shutting down " + cacheName + " cache.");
              JCS.getInstance(cacheName).clear();
              JCS.getInstance(cacheName).dispose();
            }
           catch (Exception e) {
             String msg = "Failure to clear cache " + cacheName + ":" + e.getMessage();
             logger.info(msg);
           }
         }
       }
 
开发者ID:mgarber,项目名称:scriptureV2,代码行数:16,代码来源:JCSCache.java

示例11: dispose

import org.apache.jcs.JCS; //导入依赖的package包/类
/**
 * Shuts down the specified cache, and removes it from the list of active caches so it can be
 * created again.
 * 
 * @param cacheName The name of the cache to dispose of.
 */
public static void dispose(String cacheName) {
       try {
         cacheNames.remove(cacheName);
         JCS.getInstance(cacheName).clear();
       }
       catch (CacheException e) {
         String msg = "Failure to clear cache " + cacheName + ":" + e.getMessage();
         logger.error(msg);
       }
     }
 
开发者ID:mgarber,项目名称:scriptureV2,代码行数:17,代码来源:JCSCache.java

示例12: setUp

import org.apache.jcs.JCS; //导入依赖的package包/类
protected void setUp()
    throws Exception
{
    super.setUp();
    org.apache.jcs.JCS.setConfigFilename( "/TestThrash.ccf" );
    jcs = JCS.getInstance( "testcache" );
}
 
开发者ID:mgarber,项目名称:scriptureV2,代码行数:8,代码来源:JCSTrashTest.java

示例13: hear

import org.apache.jcs.JCS; //导入依赖的package包/类
@Override
public <I> void hear(TypeLiteral<I> typeLiteral, TypeEncounter<I> encounter) {
	for (Field field : typeLiteral.getRawType().getDeclaredFields()) {
		if (field.getType() == JCS.class
				&& field.isAnnotationPresent(InjectJcs.class)) {
			//
			InjectJcs annot = field.getAnnotation(InjectJcs.class);
			MembersInjector<I> injector = new InjectJcsMembersInjector<I>(
					field, annot.cacheName());
			encounter.register(injector);
		}
	}
}
 
开发者ID:ageldama,项目名称:hotwind-jcs,代码行数:14,代码来源:InjectJcsTypeListener.java

示例14: next

import org.apache.jcs.JCS; //导入依赖的package包/类
@Override
		public AlignmentCount next() {
			Node<Integer> keyNode=iter.next();
			Collection<Alignment> reads = new HashSet<Alignment>();
			boolean flag=true;
			Alignment value=null;
			for(Integer key:keyNode.getContainedValues()){
			try{
//				for(Object key1:JCS.getInstance(cacheName).getGroupKeys(groupName)){
					//logger.info((String)key1);
//				}
//				System.out.println("Attempt to GET "+key);
				//Alignment read = (Alignment)treeCache.getFromGroup((Object)key,groupName);
				Alignment read = (Alignment)JCS.getInstance(cacheName).get((Object)key);

				if(read!=null){
					if(read.getHeader()==null)
						read.setHeader(model.getHeader());
					reads.add(read);
					//logger.info("Read is read");
				}
				else{
				
/*					if(keys.contains(key)){
						if(JCS.getInstance(cacheName).get(key)==null){
							logger.info("Read is NULL BUT CONTAINS the key");
						}
						else{
							if(keys.contains(key)){
								logger.info("Read is NULL BUT DOES NOT contain the key but KEYS contains the KEY Cache "+cacheStart+":"+cacheEnd+" VS "+key);
							}
							else
								logger.info("Read is NULL and its OKAY.");
						}
					}*/
				}				
				if(flag && read!=null){
					flag=false;
					value = read;
				}
			}catch(CacheException e){
				try {
					JCS.getInstance(cacheName).clear();
				} catch (CacheException e1) {
					logger.error(e.getMessage());
				}
				logger.error(e.getMessage());
			}
			}
			return model.new AlignmentCount(value,reads);
		}
 
开发者ID:mgarber,项目名称:scriptureV2,代码行数:52,代码来源:JCSCache.java

示例15: initCacheManager

import org.apache.jcs.JCS; //导入依赖的package包/类
/**
 * 初始化缓存管理器
 * 
 * @throws CacheException
 *             缓存异常
 */
public static void initCacheManager() throws CacheException {
    CacheManager.cache = JCS.getInstance(CACHE_REGION_NAME);
}
 
开发者ID:luckyyeah,项目名称:YiDu-Novel,代码行数:10,代码来源:CacheManager.java


注:本文中的org.apache.jcs.JCS类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。