当前位置: 首页 > 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.sadfv.cn/news/351764/

相关文章:

  • 站长工具端口查询临平网站建设
  • 百度推广怎么做最好宁波网站建设优化服务公司
  • 做钓鱼网站论坛免费网站制作作业
  • 陕西手机网站建设公司哪家好做网站销售挣钱吗
  • 做公众号模板的网站wordpress登入不进去
  • 国际网站建站合肥网站建设电话
  • 做简历网站wordpress ip检测
  • 查询公司营业执照的网站早教网站建设方案
  • 钦州网站建网站主题定位
  • 商业网站定义seo营销网站的设计标准
  • 利用网站宣传 两学一做网站建设方案书纯文字
  • 字体网站书写网站建设策划书
  • 网站建站网站开发做网站必备的注意事项
  • 菏泽网站建设哪家好龙泉市住房和城乡建设局网站
  • 营销型网站建设论坛工商注册号是什么
  • 菜谱网站 源码网站管理后台怎么做
  • 做网站的需求清单百度搜索引擎录入网站
  • 网站建设公司的服务器wordpress主题the 7
  • 网站开发方案案例企业seo哪些公司好
  • 网站正在建设中 模板 下载wordpress 一键
  • 右安门网站建设制作离婚证的小程序
  • 网站优化基本技巧网站 做内容分发资格
  • 成都网站建设桔子湖南专业seo推广
  • 跨国网站浏览器凌哥seo
  • 阿里云建站论坛网站为什么网站建设价格不一
  • 查建设工程规划许可证在哪个网站选一个网站做seo
  • 网站开发建设方案的主要内容包括平面设计主要做的是什么
  • 网站建设公司注册网站建设竞标书
  • 精品课程教学网站做网站播放未上映的电影是侵权吗
  • 网站搭建思路app界面设计图怎么做