• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FifoCache类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_FifoCache

import org.apache.ibatis.cache.decorators.FifoCache; //导入依赖的package包/类
@Test
public void test_FifoCache() {
	FifoCache fifoCache = new FifoCache(new PerpetualCache("test_fifo_cache"));
	fifoCache.setSize(2);
	assertThat(fifoCache.getSize(), equalTo(0));

	fifoCache.putObject("name", "doctor");
	assertThat(fifoCache.getSize(), equalTo(1));

	assertThat(fifoCache.getObject("name"), equalTo("doctor"));

	fifoCache.putObject("age", 2000);
	assertThat(fifoCache.getSize(), equalTo(2));
	fifoCache.putObject("sex", "man");
	assertThat(fifoCache.getSize(), equalTo(2));

	assertThat(fifoCache.getObject("name"), equalTo(null));// 第一个缓存对象被移除

}
 
开发者ID:sdcuike,项目名称:spring4-2015,代码行数:20,代码来源:FifoCachePractice.java


示例2: Configuration

import org.apache.ibatis.cache.decorators.FifoCache; //导入依赖的package包/类
public Configuration() {
  typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
  typeAliasRegistry.registerAlias("MANAGED", ManagedTransactionFactory.class);

  typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
  typeAliasRegistry.registerAlias("POOLED", PooledDataSourceFactory.class);
  typeAliasRegistry.registerAlias("UNPOOLED", UnpooledDataSourceFactory.class);

  typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
  typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
  typeAliasRegistry.registerAlias("LRU", LruCache.class);
  typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
  typeAliasRegistry.registerAlias("WEAK", WeakCache.class);

  typeAliasRegistry.registerAlias("DB_VENDOR", VendorDatabaseIdProvider.class);

  typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
  typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);

  typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
  typeAliasRegistry.registerAlias("COMMONS_LOGGING", JakartaCommonsLoggingImpl.class);
  typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
  typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
  typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
  typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
  typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);

  typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
  typeAliasRegistry.registerAlias("JAVASSIST", JavassistProxyFactory.class);

  languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
  languageRegistry.register(RawLanguageDriver.class);
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:34,代码来源:Configuration.java


示例3: shouldRemoveFirstItemInBeyondFiveEntries

import org.apache.ibatis.cache.decorators.FifoCache; //导入依赖的package包/类
@Test
public void shouldRemoveFirstItemInBeyondFiveEntries() {
  FifoCache cache = new FifoCache(new PerpetualCache("default"));
  cache.setSize(5);
  for (int i = 0; i < 5; i++) {
    cache.putObject(i, i);
  }
  assertEquals(0, cache.getObject(0));
  cache.putObject(5, 5);
  assertNull(cache.getObject(0));
  assertEquals(5, cache.getSize());
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:13,代码来源:FifoCacheTest.java


示例4: shouldRemoveItemOnDemand

import org.apache.ibatis.cache.decorators.FifoCache; //导入依赖的package包/类
@Test
public void shouldRemoveItemOnDemand() {
  FifoCache cache = new FifoCache(new PerpetualCache("default"));
  cache.putObject(0, 0);
  assertNotNull(cache.getObject(0));
  cache.removeObject(0);
  assertNull(cache.getObject(0));
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:9,代码来源:FifoCacheTest.java


示例5: shouldFlushAllItemsOnDemand

import org.apache.ibatis.cache.decorators.FifoCache; //导入依赖的package包/类
@Test
public void shouldFlushAllItemsOnDemand() {
  FifoCache cache = new FifoCache(new PerpetualCache("default"));
  for (int i = 0; i < 5; i++) {
    cache.putObject(i, i);
  }
  assertNotNull(cache.getObject(0));
  assertNotNull(cache.getObject(4));
  cache.clear();
  assertNull(cache.getObject(0));
  assertNull(cache.getObject(4));
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:13,代码来源:FifoCacheTest.java


示例6: Configuration

import org.apache.ibatis.cache.decorators.FifoCache; //导入依赖的package包/类
public Configuration() {
  // 源码解析: 注册事务工厂别名
  typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
  typeAliasRegistry.registerAlias("MANAGED", ManagedTransactionFactory.class);

  // 源码解析: 注册数据源工厂别名
  typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
  typeAliasRegistry.registerAlias("POOLED", PooledDataSourceFactory.class);
  typeAliasRegistry.registerAlias("UNPOOLED", UnpooledDataSourceFactory.class);

  // 源码解析: 注册缓存别名
  typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
  typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
  typeAliasRegistry.registerAlias("LRU", LruCache.class);
  typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
  typeAliasRegistry.registerAlias("WEAK", WeakCache.class);

  // 源码解析: 注册VendorDatabaseIdProvider别名
  typeAliasRegistry.registerAlias("DB_VENDOR", VendorDatabaseIdProvider.class);

  // 源码解析: 注册LanguageDriver别名
  typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
  typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);

  // 源码解析: 注册日志实现别名
  typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
  typeAliasRegistry.registerAlias("COMMONS_LOGGING", JakartaCommonsLoggingImpl.class);
  typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
  typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
  typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
  typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
  typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);

  // 源码解析: 注册代理工厂别名
  typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
  typeAliasRegistry.registerAlias("JAVASSIST", JavassistProxyFactory.class);

  languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
  languageRegistry.register(RawLanguageDriver.class);
}
 
开发者ID:txazo,项目名称:mybatis,代码行数:41,代码来源:Configuration.java


示例7: Configuration

import org.apache.ibatis.cache.decorators.FifoCache; //导入依赖的package包/类
public Configuration() {
	typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
	typeAliasRegistry.registerAlias("MANAGED",
			ManagedTransactionFactory.class);

	typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
	typeAliasRegistry
			.registerAlias("POOLED", PooledDataSourceFactory.class);
	typeAliasRegistry.registerAlias("UNPOOLED",
			UnpooledDataSourceFactory.class);

	typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
	typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
	typeAliasRegistry.registerAlias("LRU", LruCache.class);
	typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
	typeAliasRegistry.registerAlias("WEAK", WeakCache.class);

	typeAliasRegistry.registerAlias("DB_VENDOR",
			VendorDatabaseIdProvider.class);

	typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
	typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);

	typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
	typeAliasRegistry.registerAlias("COMMONS_LOGGING",
			JakartaCommonsLoggingImpl.class);
	typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
	typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
	typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
	typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
	typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);

	typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
	typeAliasRegistry.registerAlias("JAVASSIST",
			JavassistProxyFactory.class);

	languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
	languageRegistry.register(RawLanguageDriver.class);
}
 
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:40,代码来源:Configuration.java


示例8: Configuration

import org.apache.ibatis.cache.decorators.FifoCache; //导入依赖的package包/类
public Configuration() {
	typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
	typeAliasRegistry.registerAlias("MANAGED", ManagedTransactionFactory.class);

	typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
	typeAliasRegistry.registerAlias("POOLED", PooledDataSourceFactory.class);
	typeAliasRegistry.registerAlias("UNPOOLED", UnpooledDataSourceFactory.class);

	typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
	typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
	typeAliasRegistry.registerAlias("LRU", LruCache.class);
	typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
	typeAliasRegistry.registerAlias("WEAK", WeakCache.class);

	typeAliasRegistry.registerAlias("DB_VENDOR", VendorDatabaseIdProvider.class);

	typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
	typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);

	typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
	typeAliasRegistry.registerAlias("COMMONS_LOGGING", JakartaCommonsLoggingImpl.class);
	typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
	typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
	typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
	typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
	typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);

	typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
	typeAliasRegistry.registerAlias("JAVASSIST", JavassistProxyFactory.class);

	languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
	languageRegistry.register(RawLanguageDriver.class);
}
 
开发者ID:whatlookingfor,项目名称:spring-boot-sample,代码行数:34,代码来源:Configuration.java


示例9: Configuration

import org.apache.ibatis.cache.decorators.FifoCache; //导入依赖的package包/类
public Configuration() {
  //注册更多的类型别名,至于为何不直接在TypeAliasRegistry里注册,还需进一步研究
  typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
  typeAliasRegistry.registerAlias("MANAGED", ManagedTransactionFactory.class);

  typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
  typeAliasRegistry.registerAlias("POOLED", PooledDataSourceFactory.class);
  typeAliasRegistry.registerAlias("UNPOOLED", UnpooledDataSourceFactory.class);

  typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
  typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
  typeAliasRegistry.registerAlias("LRU", LruCache.class);
  typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
  typeAliasRegistry.registerAlias("WEAK", WeakCache.class);

  typeAliasRegistry.registerAlias("DB_VENDOR", VendorDatabaseIdProvider.class);

  typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
  typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);

  typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
  typeAliasRegistry.registerAlias("COMMONS_LOGGING", JakartaCommonsLoggingImpl.class);
  typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
  typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
  typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
  typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
  typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);

  typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
  typeAliasRegistry.registerAlias("JAVASSIST", JavassistProxyFactory.class);

  languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
  languageRegistry.register(RawLanguageDriver.class);
}
 
开发者ID:shurun19851206,项目名称:mybaties,代码行数:35,代码来源:Configuration.java


示例10: Configuration

import org.apache.ibatis.cache.decorators.FifoCache; //导入依赖的package包/类
public Configuration() {
//事务类型
  typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
  typeAliasRegistry.registerAlias("MANAGED", ManagedTransactionFactory.class);
  //数据源与连接池类型
  typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
  typeAliasRegistry.registerAlias("POOLED", PooledDataSourceFactory.class);
  typeAliasRegistry.registerAlias("UNPOOLED", UnpooledDataSourceFactory.class);

  typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
  typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
  typeAliasRegistry.registerAlias("LRU", LruCache.class);
  typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
  typeAliasRegistry.registerAlias("WEAK", WeakCache.class);

  typeAliasRegistry.registerAlias("DB_VENDOR", VendorDatabaseIdProvider.class);

  typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
  typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);

  typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
  typeAliasRegistry.registerAlias("COMMONS_LOGGING", JakartaCommonsLoggingImpl.class);
  typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
  typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
  typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
  typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
  typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);

  typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
  typeAliasRegistry.registerAlias("JAVASSIST", JavassistProxyFactory.class);

  languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
  languageRegistry.register(RawLanguageDriver.class);
}
 
开发者ID:toulezu,项目名称:play,代码行数:35,代码来源:Configuration.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MockJobs类代码示例发布时间:2022-05-22
下一篇:
Java Enumerated类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap