当前位置: 首页 > news >正文

做女装的看哪个网站好汕尾手机网站开发

做女装的看哪个网站好,汕尾手机网站开发,wordpress 商品 模板下载,中山网站开发公司我最近在博客中谈论有关Spring 3.1及其新的缓存注释Cacheable和CacheEvict 。 与所有Spring功能一样#xff0c;您需要进行一定数量的设置#xff0c;并且通常使用Spring的XML配置文件来完成。 在缓存的情况下#xff0c;打开Cacheable和CacheEvict并不容易#xff0c;因为… 我最近在博客中谈论有关Spring 3.1及其新的缓存注释Cacheable和CacheEvict 。 与所有Spring功能一样您需要进行一定数量的设置并且通常使用Spring的XML配置文件来完成。 在缓存的情况下打开Cacheable和CacheEvict并不容易因为您要做的就是将以下内容添加到Spring配置文件中 cache:annotation-driven / …以及您的beans XML元素声明中的适当模式定义 beans xmlnshttp://www.springframework.org/schema/beans xmlns:phttp://www.springframework.org/schema/pxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:cachehttp://www.springframework.org/schema/cache xmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.1.xsdhttp://www.springframework.org/schema/cachehttp://www.springframework.org/schema/cache/spring-cache.xsd …的主要特点是 xmlns:cachehttp://www.springframework.org/schema/cache …和 http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd 但是这还不是故事的结局因为您还需要指定一个缓存管理器和一个缓存实现。 好消息是如果您熟悉其他Spring组件例如数据库事务管理器的设置那么这样做的方式就不足为奇了。 缓存管理器类似乎是实现Spring的org.springframework.cache.CacheManager接口的任何类。 它负责管理一个或多个缓存实施其中缓存实施实例负责实际缓存数据。 下面的XML示例摘自我最近两个博客中使用的示例代码。 bean idcacheManager classorg.springframework.cache.support.SimpleCacheManagerproperty namecachessetbeanclassorg.springframework.cache.concurrent.ConcurrentMapCacheFactoryBeanp:nameemployee/!-- TODO Add other cache instances in here--/set/property /bean 在上面的配置中我使用Spring的SimpleCacheManager来管理其ConcurrentMapCacheFactoryBean实例该实例的缓存实现名为“ employee ”。 需要注意的重要一点是您的缓存管理器必须具有cacheManager 。 如果您弄错了那么将得到以下异常 org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.cache.interceptor.CacheInterceptor#0: Cannot resolve reference to bean cacheManager while setting bean property cacheManager; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named cacheManager is definedat org.springframework.beans.factory.support.BeanDefinitionValueResolver. resolveReference(BeanDefinitionValueResolver.java:328)at org.springframework.beans.factory.support.BeanDefinitionValueResolver. resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory. applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory. populateBean(AbstractAutowireCapableBeanFactory.java:1118)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory. doCreateBean(AbstractAutowireCapableBeanFactory.java:517) : : trace details removed for clarity :at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. runTests(RemoteTestRunner.java:683)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. run(RemoteTestRunner.java:390)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. main(RemoteTestRunner.java:197) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named cacheManager is definedat org.springframework.beans.factory.support.DefaultListableBeanFactory. getBeanDefinition(DefaultListableBeanFactory.java:553)at org.springframework.beans.factory.support.AbstractBeanFactory. getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)at org.springframework.beans.factory.support.AbstractBeanFactory. doGetBean(AbstractBeanFactory.java:277)at org.springframework.beans.factory.support.AbstractBeanFactory. getBean(AbstractBeanFactory.java:193)at org.springframework.beans.factory.support.BeanDefinitionValueResolver. resolveReference(BeanDefinitionValueResolver.java:322) 就像我在上面说的那样在我的简单配置中整个工作由SimpleCacheManager协调。 根据文档这通常是“用于测试或简单的缓存声明”。 尽管您可以编写自己的CacheManager实现但Spring的专家们为不同情况提供了其他缓存管理器 SimpleCacheManager –参见上文。 NoOpCacheManager –用于测试因为它实际上并不缓存任何内容尽管在这里要小心因为在不进行缓存的情况下测试代码可能会在打开缓存时使您绊倒。 CompositeCacheManager –允许在单个应用程序中使用多个缓存管理器。 EhCacheCacheManager –包装ehCache实例的缓存管理器。 见http://ehcache.org 对于Spring Profile选择在任何给定环境中使用哪个缓存管理器似乎是一个很好的用途。 看到 在XML Config中使用Spring配置文件 使用Spring Profiles和Java配置 而且尽管只是为了完整起见但这只是将内容整理一下下面是我前两个博客中使用的完整配置文件 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beans xmlns:phttp://www.springframework.org/schema/pxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:cachehttp://www.springframework.org/schema/cache xmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsdhttp://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd!-- Switch on the Caching --cache:annotation-driven /!-- Do the component scan path --context:component-scan base-packagecaching /!-- simple cache manager --bean idcacheManager classorg.springframework.cache.support.SimpleCacheManagerproperty namecachessetbean classorg.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean p:nameemployee/!-- TODO Add other cache instances in here--/set/property/bean/beans 正如哥伦波中尉喜欢说“还有一件事你知道让我为这个案件烦恼……” 好吧关于缓存管理器有几件事让我感到困扰例如 在谈论SimpleCacheManager时Spring的家伙们所说的“对测试或简单的缓存声明有用”是什么意思 您究竟应该何时愤怒地使用它而不是进行测试 最好编写自己的CacheManager实现甚至是Cache实现吗 使用EhCacheCacheManager确切优势是什么 您真正需要多少时间CompositeCacheManager 我将来可能会研究所有这些…… 祝您编程愉快别忘了分享 参考来自Captain Debugs Blog博客的JCG合作伙伴 Roger Hughes的Spring 3.1 Caching and Config 。 翻译自: https://www.javacodegeeks.com/2012/09/spring-31-caching-and-config.html
http://www.huolong8.cn/news/351764/

相关文章:

  • 免费网站免费进入在线网站建设客户来源
  • 一个域名解析多个网站网页制作教程width
  • qq网站代码flashxml网站模板
  • 做app和做网站太仓网站建设平台
  • 宇宙企画网站河源今天发生的重大新闻
  • 响应式设计网站wordpress 汽车 模板下载
  • 长春火车站官网wordpress search提示
  • 郑州做网站琴免费咨询口腔科医生回答在线
  • 抚顺市营商环境建设局网站网站网站自己做
  • 人才网站建设的目标医疗机构 网站备案
  • 企业级网站开发原理图房产网址
  • 旅游网站建设规划报告怎么写网站配置伪静态
  • 做网站用什么主机好西宁手机微网站
  • 物流管理网站怎么做wordpress社交插件
  • 利用高权重网站做关键词关键词那种网站
  • 网站上线步骤wordpress 4.6.1 漏洞
  • 域名网站平台如何学习网站开发编程
  • 深圳专业网站建设企网站怎么做ipfs
  • 宁波创建网站河南郑州网站建设哪家公司好
  • 购物网站难做简约的网页设计欣赏
  • 广东工程建设咨询有限公司网站电子商务网站建设选择
  • 简单的网站设计开发智慧团建注册登录入口下载
  • 网站建设业务员论坛php网站开发工程师任职要求
  • 怎么做网站运营重庆seo技术教程
  • 网站优化如何收费企业邮箱收费
  • 网站建设成本包括什么丹阳seo公司
  • 广州建设网站哪个好html网页制作完整代码
  • 建各企业网站多少钱权重域名做网站有用么
  • 做网站优化常用工具装饰设计学校
  • 做小型企业网站多少钱织梦建站模板