??xml version="1.0" encoding="utf-8" standalone="yes"?>99精品国产99久久久久久福利,fc2在线中文字幕,亚洲啪啪91http://www.aygfsteel.com/xmatthew/category/35679.html孤独键盘?/description>zh-cnFri, 09 Apr 2021 10:37:01 GMTFri, 09 Apr 2021 10:37:01 GMT60兼容原生SpringBoot配置规范Q?BRCC助你一站式解决目配置需?/title><link>http://www.aygfsteel.com/xmatthew/archive/2021/04/08/435848.html</link><dc:creator>x.matthew</dc:creator><author>x.matthew</author><pubDate>Thu, 08 Apr 2021 12:00:00 GMT</pubDate><guid>http://www.aygfsteel.com/xmatthew/archive/2021/04/08/435848.html</guid><wfw:comment>http://www.aygfsteel.com/xmatthew/comments/435848.html</wfw:comment><comments>http://www.aygfsteel.com/xmatthew/archive/2021/04/08/435848.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xmatthew/comments/commentRss/435848.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xmatthew/services/trackbacks/435848.html</trackback:ping><description><![CDATA[     摘要: 1. Springboot configCZ与原理介l?.1 Springboot configCZSpringbootl我们提供了(jin)非常便捷与方便的配置使用方式Q常用的使用CZ有以下两U:(x)1Q用@ConfigurationProperties d多个属性用方法:(x)@ConfigurationProperties(prefix = "spring.datasource")使用说明Q提?..  <a href='http://www.aygfsteel.com/xmatthew/archive/2021/04/08/435848.html'>阅读全文</a><img src ="http://www.aygfsteel.com/xmatthew/aggbug/435848.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xmatthew/" target="_blank">x.matthew</a> 2021-04-08 20:00 <a href="http://www.aygfsteel.com/xmatthew/archive/2021/04/08/435848.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jprotobuf-rpc-httplg?.0发布Q可支持直接把Protobuf IDL定义发布成RPC服务应用http://www.aygfsteel.com/xmatthew/archive/2014/10/10/418592.htmlx.matthewx.matthewFri, 10 Oct 2014 07:20:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2014/10/10/418592.htmlhttp://www.aygfsteel.com/xmatthew/comments/418592.htmlhttp://www.aygfsteel.com/xmatthew/archive/2014/10/10/418592.html#Feedback0http://www.aygfsteel.com/xmatthew/comments/commentRss/418592.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/418592.html阅读全文

x.matthew 2014-10-10 15:20 发表评论
]]>
Mybatis Laz-Load功能实现代码赏析(原创)http://www.aygfsteel.com/xmatthew/archive/2011/12/29/367523.htmlx.matthewx.matthewThu, 29 Dec 2011 11:14:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2011/12/29/367523.htmlhttp://www.aygfsteel.com/xmatthew/comments/367523.htmlhttp://www.aygfsteel.com/xmatthew/archive/2011/12/29/367523.html#Feedback1http://www.aygfsteel.com/xmatthew/comments/commentRss/367523.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/367523.html阅读全文

x.matthew 2011-12-29 19:14 发表评论
]]>
源码解读Mybatis List列表In查询实现的注意事?/title><link>http://www.aygfsteel.com/xmatthew/archive/2011/08/31/355879.html</link><dc:creator>x.matthew</dc:creator><author>x.matthew</author><pubDate>Wed, 31 Aug 2011 06:38:00 GMT</pubDate><guid>http://www.aygfsteel.com/xmatthew/archive/2011/08/31/355879.html</guid><wfw:comment>http://www.aygfsteel.com/xmatthew/comments/355879.html</wfw:comment><comments>http://www.aygfsteel.com/xmatthew/archive/2011/08/31/355879.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xmatthew/comments/commentRss/355879.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xmatthew/services/trackbacks/355879.html</trackback:ping><description><![CDATA[     摘要: 在SQL开发过E中Q动态构建In集合条g查询是比较常见的用法Q在Mybatis中提供了(jin)foreach功能Q该功能比较强大Q但׃官方文档对这块的使用Q描q的比较短,l节上也被忽略掉?可能是开源项目文档一贯的问题?Q也使用不少同学在用中遇到?jin)问题。特别是foreachq个函数中,collection属性做什么用Q有什么注意事V由于文档不全,q块只能通过源代码剖析的方式来分析一下各个属性的相关要求?nbsp; <a href='http://www.aygfsteel.com/xmatthew/archive/2011/08/31/355879.html'>阅读全文</a><img src ="http://www.aygfsteel.com/xmatthew/aggbug/355879.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xmatthew/" target="_blank">x.matthew</a> 2011-08-31 14:38 <a href="http://www.aygfsteel.com/xmatthew/archive/2011/08/31/355879.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Spring声明式事务配|详?/title><link>http://www.aygfsteel.com/xmatthew/archive/2011/06/23/352871.html</link><dc:creator>x.matthew</dc:creator><author>x.matthew</author><pubDate>Thu, 23 Jun 2011 05:25:00 GMT</pubDate><guid>http://www.aygfsteel.com/xmatthew/archive/2011/06/23/352871.html</guid><wfw:comment>http://www.aygfsteel.com/xmatthew/comments/352871.html</wfw:comment><comments>http://www.aygfsteel.com/xmatthew/archive/2011/06/23/352871.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xmatthew/comments/commentRss/352871.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xmatthew/services/trackbacks/352871.html</trackback:ping><description><![CDATA[     摘要: Spring声明式事务功能应该是大家应用Spring中用的最多的功能之一?jin),的确该功能极大的化了(jin)大家Ҏ(gu)据库操作的。目前Spring支持的声明式事务有两个配|方式,一U是XML配置方式Q另一U是注解方式 <br> <br>针对配置q块QXML配置同学们会(x)觉得比较ȝ(ch)Q特别是针对事务属性的配置Q所以补充一下本块配|说明,特分享给大家Q希望对大家有帮助?nbsp; <a href='http://www.aygfsteel.com/xmatthew/archive/2011/06/23/352871.html'>阅读全文</a><img src ="http://www.aygfsteel.com/xmatthew/aggbug/352871.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xmatthew/" target="_blank">x.matthew</a> 2011-06-23 13:25 <a href="http://www.aygfsteel.com/xmatthew/archive/2011/06/23/352871.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Spring 2.x框架学习(fn)(q蝲)-?jin)解AOPhttp://www.aygfsteel.com/xmatthew/archive/2011/04/01/347448.htmlx.matthewx.matthewFri, 01 Apr 2011 02:52:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2011/04/01/347448.htmlhttp://www.aygfsteel.com/xmatthew/comments/347448.htmlhttp://www.aygfsteel.com/xmatthew/archive/2011/04/01/347448.html#Feedback0http://www.aygfsteel.com/xmatthew/comments/commentRss/347448.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/347448.html
本篇技术文章介lSpring AOP的实现?nbsp; 阅读全文

x.matthew 2011-04-01 10:52 发表评论
]]>
Spring 2.x框架学习(fn)(q蝲)-?jin)解Spring基础http://www.aygfsteel.com/xmatthew/archive/2011/03/14/346261.htmlx.matthewx.matthewMon, 14 Mar 2011 11:24:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2011/03/14/346261.htmlhttp://www.aygfsteel.com/xmatthew/comments/346261.htmlhttp://www.aygfsteel.com/xmatthew/archive/2011/03/14/346261.html#Feedback3http://www.aygfsteel.com/xmatthew/comments/commentRss/346261.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/346261.html
本篇技术文章将作ؓ(f)Spring入门?
  阅读全文

x.matthew 2011-03-14 19:24 发表评论
]]>
Struts 单元试Ҏ(gu)http://www.aygfsteel.com/xmatthew/archive/2011/02/27/338714.htmlx.matthewx.matthewSun, 27 Feb 2011 11:15:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2011/02/27/338714.htmlhttp://www.aygfsteel.com/xmatthew/comments/338714.htmlhttp://www.aygfsteel.com/xmatthew/archive/2011/02/27/338714.html#Feedback2http://www.aygfsteel.com/xmatthew/comments/commentRss/338714.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/338714.html阅读全文

x.matthew 2011-02-27 19:15 发表评论
]]>
Hibernate envers开发指?/title><link>http://www.aygfsteel.com/xmatthew/archive/2010/08/22/329521.html</link><dc:creator>x.matthew</dc:creator><author>x.matthew</author><pubDate>Sun, 22 Aug 2010 15:20:00 GMT</pubDate><guid>http://www.aygfsteel.com/xmatthew/archive/2010/08/22/329521.html</guid><wfw:comment>http://www.aygfsteel.com/xmatthew/comments/329521.html</wfw:comment><comments>http://www.aygfsteel.com/xmatthew/archive/2010/08/22/329521.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xmatthew/comments/commentRss/329521.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xmatthew/services/trackbacks/329521.html</trackback:ping><description><![CDATA[     摘要: 介绍: <br>Hibernate Envers目的是根据对实体的设|,提供记录执行数据变更历史的功?数据变更版本)。它实现原理是通过对Hibernate的操作事件监听ƈҎ(gu) <br>ZAnnoatation的配|来记录修改数据的内宏V?nbsp; <a href='http://www.aygfsteel.com/xmatthew/archive/2010/08/22/329521.html'>阅读全文</a><img src ="http://www.aygfsteel.com/xmatthew/aggbug/329521.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xmatthew/" target="_blank">x.matthew</a> 2010-08-22 23:20 <a href="http://www.aygfsteel.com/xmatthew/archive/2010/08/22/329521.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>源代码解d于Spring的声明性缓存实现原?/title><link>http://www.aygfsteel.com/xmatthew/archive/2010/05/13/320915.html</link><dc:creator>x.matthew</dc:creator><author>x.matthew</author><pubDate>Thu, 13 May 2010 11:53:00 GMT</pubDate><guid>http://www.aygfsteel.com/xmatthew/archive/2010/05/13/320915.html</guid><wfw:comment>http://www.aygfsteel.com/xmatthew/comments/320915.html</wfw:comment><comments>http://www.aygfsteel.com/xmatthew/archive/2010/05/13/320915.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xmatthew/comments/commentRss/320915.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xmatthew/services/trackbacks/320915.html</trackback:ping><description><![CDATA[     摘要: 在上博客中Q介l了(jin)如何借助Spring Module目Q配|声明式~存功能实现Q文中只针对Ehcahce的实现进行了(jin)讲解Q其它Spring Module目把这块的功能做了(jin)一个很好的抽取Q其能更好的对其它的缓存框架的支持和扩展。笔者正好利用该代码框架实现?jin)与Memcached服务的集成,本文得炚w过源代码解讲一下抽取这层的实现Q希望大家有所帮助?nbsp; <a href='http://www.aygfsteel.com/xmatthew/archive/2010/05/13/320915.html'>阅读全文</a><img src ="http://www.aygfsteel.com/xmatthew/aggbug/320915.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xmatthew/" target="_blank">x.matthew</a> 2010-05-13 19:53 <a href="http://www.aygfsteel.com/xmatthew/archive/2010/05/13/320915.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>源代码解读Spring只读事务与读写事务的性能的差?/title><link>http://www.aygfsteel.com/xmatthew/archive/2010/05/06/320123.html</link><dc:creator>x.matthew</dc:creator><author>x.matthew</author><pubDate>Thu, 06 May 2010 11:31:00 GMT</pubDate><guid>http://www.aygfsteel.com/xmatthew/archive/2010/05/06/320123.html</guid><wfw:comment>http://www.aygfsteel.com/xmatthew/comments/320123.html</wfw:comment><comments>http://www.aygfsteel.com/xmatthew/archive/2010/05/06/320123.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xmatthew/comments/commentRss/320123.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xmatthew/services/trackbacks/320123.html</trackback:ping><description><![CDATA[     摘要: 前言Q?<br> 如果大家使用qSpring事务理Q会(x)发现Spring提供的事务分为“只诠Z和“读写”事务两cR这不免׃(x)疑问q两U事务会(x)有什么不同?本文则通过对Spring和Hibernate源代码的剖析来找?gu)两种事务的区别。特别是q行性能斚w的区别?<br> 文章调试使用的版本ؓ(f) Spring 2.5.6.SEC01 QHibernate 3.3.2.GA?nbsp; <a href='http://www.aygfsteel.com/xmatthew/archive/2010/05/06/320123.html'>阅读全文</a><img src ="http://www.aygfsteel.com/xmatthew/aggbug/320123.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xmatthew/" target="_blank">x.matthew</a> 2010-05-06 19:31 <a href="http://www.aygfsteel.com/xmatthew/archive/2010/05/06/320123.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>借助Spring Module目Q如何配|声明式~存功能实现http://www.aygfsteel.com/xmatthew/archive/2010/04/22/319146.htmlx.matthewx.matthewThu, 22 Apr 2010 11:47:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2010/04/22/319146.htmlhttp://www.aygfsteel.com/xmatthew/comments/319146.htmlhttp://www.aygfsteel.com/xmatthew/archive/2010/04/22/319146.html#Feedback4http://www.aygfsteel.com/xmatthew/comments/commentRss/319146.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/319146.html 本文档将讲解一下,如何借助Spring Module目Q实现配|声明性缓存功能?
说明:
本档的配|经q本人测试,都能正确q行?
q行环境Q?Jdk5.0, Spring-2.5, Spring-modules-0.9Q?ehcache-1.6.0-beta4.jar  阅读全文

x.matthew 2010-04-22 19:47 发表评论
]]>
Spring 3.0 M2发布, 大部分新Ҏ(gu)已l开发完?/title><link>http://www.aygfsteel.com/xmatthew/archive/2009/02/27/257091.html</link><dc:creator>x.matthew</dc:creator><author>x.matthew</author><pubDate>Fri, 27 Feb 2009 13:10:00 GMT</pubDate><guid>http://www.aygfsteel.com/xmatthew/archive/2009/02/27/257091.html</guid><wfw:comment>http://www.aygfsteel.com/xmatthew/comments/257091.html</wfw:comment><comments>http://www.aygfsteel.com/xmatthew/archive/2009/02/27/257091.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xmatthew/comments/commentRss/257091.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xmatthew/services/trackbacks/257091.html</trackback:ping><description><![CDATA[     摘要: 期待q么长时_(d)l于在SpringSource官方|站发布?jin)M2版本Q大部分新特性已l开发完?<br> <br> * 从Spring3.0开始,只支持java 5?qing)以上的版本。开始泛型的支持QM2版本中的HibernateTemplate已经实现?jin)泛型的支持?<br> * 扩展?jin)对q发的支持。M2版本对java 5?java.util.concurrent cdq行更紧密的集成。在来的Spring 3.0 M3版本?x)更q一步对配置q行单,以方便用?nbsp; <a href='http://www.aygfsteel.com/xmatthew/archive/2009/02/27/257091.html'>阅读全文</a><img src ="http://www.aygfsteel.com/xmatthew/aggbug/257091.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xmatthew/" target="_blank">x.matthew</a> 2009-02-27 21:10 <a href="http://www.aygfsteel.com/xmatthew/archive/2009/02/27/257091.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Spring Integration 1.0 正式发布http://www.aygfsteel.com/xmatthew/archive/2008/12/04/243443.htmlx.matthewx.matthewThu, 04 Dec 2008 00:33:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/12/04/243443.htmlhttp://www.aygfsteel.com/xmatthew/comments/243443.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/12/04/243443.html#Feedback3http://www.aygfsteel.com/xmatthew/comments/commentRss/243443.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/243443.html 下面是本Z取第一时整理的学习(fn)W记(针对最新版?  阅读全文

x.matthew 2008-12-04 08:33 发表评论
]]>
Spring Integration 1.0学习(fn)W记(?http://www.aygfsteel.com/xmatthew/archive/2008/12/04/243455.htmlx.matthewx.matthewThu, 04 Dec 2008 00:33:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/12/04/243455.htmlhttp://www.aygfsteel.com/xmatthew/comments/243455.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/12/04/243455.html#Feedback0http://www.aygfsteel.com/xmatthew/comments/commentRss/243455.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/243455.html本笔记接下讲解以Annotation的方式来使用Spring-integration的例子。还是之前的那个CZ:
  阅读全文

x.matthew 2008-12-04 08:33 发表评论
]]>
What is Spring?http://www.aygfsteel.com/xmatthew/archive/2008/12/01/243801.htmlx.matthewx.matthewMon, 01 Dec 2008 14:04:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/12/01/243801.htmlhttp://www.aygfsteel.com/xmatthew/comments/243801.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/12/01/243801.html#Feedback6http://www.aygfsteel.com/xmatthew/comments/commentRss/243801.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/243801.html
其实在Spring官方|站是具体的介l,下面本h对其译成?jin)中?如有译不当之处Q敬请各位指正?nbsp; 阅读全文

x.matthew 2008-12-01 22:04 发表评论
]]>
JBoss Envers 学习(fn)W记 http://www.aygfsteel.com/xmatthew/archive/2008/11/14/238432.htmlx.matthewx.matthewFri, 14 Nov 2008 04:14:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/11/14/238432.htmlhttp://www.aygfsteel.com/xmatthew/comments/238432.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/11/14/238432.html#Feedback1http://www.aygfsteel.com/xmatthew/comments/commentRss/238432.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/238432.html JBoss Envers目的是根据对实体的设|,提供记录执行数据变更历史的功?数据变更版本)。Envers的配|非常简单,如果需要对某个实例q行历史数据版本记录Q只需要在实例上配|@Versioned annotation卛_。针Ҏ(gu)个实体的版本的历史数?Envers都会(x)创徏一个单独的数据表进行存储?nbsp; 阅读全文

x.matthew 2008-11-14 12:14 发表评论
]]>
Spring Integration 1.0 RC1 版本发布 http://www.aygfsteel.com/xmatthew/archive/2008/11/08/239395.htmlx.matthewx.matthewSat, 08 Nov 2008 04:53:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/11/08/239395.htmlhttp://www.aygfsteel.com/xmatthew/comments/239395.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/11/08/239395.html#Feedback1http://www.aygfsteel.com/xmatthew/comments/commentRss/239395.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/239395.html 下面是本人先前整理的学习(fn)W记(目前只针对M6版本QRC1版有一些改动,正在整理?  阅读全文

x.matthew 2008-11-08 12:53 发表评论
]]>
Spring 2.5.6正式发布http://www.aygfsteel.com/xmatthew/archive/2008/11/06/238971.htmlx.matthewx.matthewThu, 06 Nov 2008 02:25:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/11/06/238971.htmlhttp://www.aygfsteel.com/xmatthew/comments/238971.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/11/06/238971.html#Feedback0http://www.aygfsteel.com/xmatthew/comments/commentRss/238971.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/238971.html
按照官方3.0版本开发的说明QSpring 2.5.6会(x)是Spring 2.5分支的最后一个版Q整个开发团队将?x)全力投入?3.0版本的开发工作?.0版的MVC会(x)对Restq行支持?
Spring 3.0 is in progress now! view roadmap click here  阅读全文

x.matthew 2008-11-06 10:25 发表评论
]]>
通过Spring2.5对单元测试的Annotation支持q行TDD开?/title><link>http://www.aygfsteel.com/xmatthew/archive/2008/11/05/238697.html</link><dc:creator>x.matthew</dc:creator><author>x.matthew</author><pubDate>Wed, 05 Nov 2008 11:40:00 GMT</pubDate><guid>http://www.aygfsteel.com/xmatthew/archive/2008/11/05/238697.html</guid><wfw:comment>http://www.aygfsteel.com/xmatthew/comments/238697.html</wfw:comment><comments>http://www.aygfsteel.com/xmatthew/archive/2008/11/05/238697.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xmatthew/comments/commentRss/238697.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xmatthew/services/trackbacks/238697.html</trackback:ping><description><![CDATA[     摘要: 本文从一个例子出发,Ҏ(gu)TDD(试驱动开?要求Q进行开发。只是用于演C如何用Spring2.5提供的基于Annonation方式的IOC实现Q进行TDD开发?<br> <br>首先我们来看一下这个例子的要求: <br> 开发一个购物R对象,可以d商品Q删除商品,查询已购商口Q结账功能?nbsp; <a href='http://www.aygfsteel.com/xmatthew/archive/2008/11/05/238697.html'>阅读全文</a><img src ="http://www.aygfsteel.com/xmatthew/aggbug/238697.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xmatthew/" target="_blank">x.matthew</a> 2008-11-05 19:40 <a href="http://www.aygfsteel.com/xmatthew/archive/2008/11/05/238697.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Spring2 提供的remote包学?fn)笔?/title><link>http://www.aygfsteel.com/xmatthew/archive/2008/11/02/238208.html</link><dc:creator>x.matthew</dc:creator><author>x.matthew</author><pubDate>Sun, 02 Nov 2008 11:20:00 GMT</pubDate><guid>http://www.aygfsteel.com/xmatthew/archive/2008/11/02/238208.html</guid><wfw:comment>http://www.aygfsteel.com/xmatthew/comments/238208.html</wfw:comment><comments>http://www.aygfsteel.com/xmatthew/archive/2008/11/02/238208.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xmatthew/comments/commentRss/238208.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xmatthew/services/trackbacks/238208.html</trackback:ping><description><![CDATA[     摘要: Spring2 针对q程讉K服务Q提供的一个remote包。其的的是提供一套统一的远E服务发布功能?<br>Spring2支持q程服务功能如下: <br> 1. RMI服务 <br> 2. Hessian或者Burlap通过HTTPq程调用服务 <br> 3. HTTP调用器暴露服? <br>本文l合源码CZQ来讲解如何实现q些功能发布?nbsp; <a href='http://www.aygfsteel.com/xmatthew/archive/2008/11/02/238208.html'>阅读全文</a><img src ="http://www.aygfsteel.com/xmatthew/aggbug/238208.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xmatthew/" target="_blank">x.matthew</a> 2008-11-02 19:20 <a href="http://www.aygfsteel.com/xmatthew/archive/2008/11/02/238208.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Hibernate配置文g中几U实现数据库q接方式的配|方?/title><link>http://www.aygfsteel.com/xmatthew/archive/2008/10/19/235332.html</link><dc:creator>x.matthew</dc:creator><author>x.matthew</author><pubDate>Sun, 19 Oct 2008 13:19:00 GMT</pubDate><guid>http://www.aygfsteel.com/xmatthew/archive/2008/10/19/235332.html</guid><wfw:comment>http://www.aygfsteel.com/xmatthew/comments/235332.html</wfw:comment><comments>http://www.aygfsteel.com/xmatthew/archive/2008/10/19/235332.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xmatthew/comments/commentRss/235332.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xmatthew/services/trackbacks/235332.html</trackback:ping><description><![CDATA[  参读?jin)Hibernate的源代码后,整理?jin)一下Hibernate配置文g中几U实现数据库q接方式的配|方法?共四个方?<br />    1. E序内部启动 c3p0 q接池?br />    配置方式如下:q接池的支持(注:(x)需要c3p0的类库支? <br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);">        <</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.driver_class"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="org.postgresql.Driver"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.url"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="jdbc:postgresql://xxxxx/xxxx"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.username"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="xxxxx"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.password"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="xxxx"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.c3p0.min_size"</span><span style="color: rgb(255, 0, 0);"><br />                     value</span><span style="color: rgb(0, 0, 255);">="5"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.c3p0.max_size"</span><span style="color: rgb(255, 0, 0);"><br />                     value</span><span style="color: rgb(0, 0, 255);">="20"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.c3p0.timeout"</span><span style="color: rgb(255, 0, 0);"><br />                     value</span><span style="color: rgb(0, 0, 255);">="300"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.c3p0.max_statements"</span><span style="color: rgb(255, 0, 0);"><br />                     value</span><span style="color: rgb(0, 0, 255);">="50"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.c3p0.idle_test_period"</span><span style="color: rgb(255, 0, 0);"><br />                     value</span><span style="color: rgb(0, 0, 255);">="3000"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);">    <br /> </span></div>    注:(x) HibernateҎ(gu) hibernate.c3p0.max_size q个配置来识别是支持c3p0q接?br /> <br />    2. 引用外部q接?nbsp;   (通过JNDI查找 DataSource资料)<br />    需要配|方式如?<br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);">      <</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.datasource"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="java:comp/env/jdbc/qualitydb"</span><span style="color: rgb(0, 0, 255);">/></span></div> <br />    3. 通过 org.hibernate.connection.ProxoolConnectionProvider 创徏<br />     ?<br />        hibernate.proxool.xml<br />        hibernate.proxool.properties<br />        hibernate.proxool.existing_pool 三个配置一h定<br /> <br />    4.  DriverManager 创徏直接q接方式<br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);">       <</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.driver_class"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="org.postgresql.Driver"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.url"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="jdbc:postgresql://xxxxx/xxxx"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.username"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="xxxxx"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.password"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="xxxx"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span></div>     注:(x) HibernateҎ(gu) hibernate.connection.urlq个来识?׃在识别时Qc3p0的优先?x)高于DriverManger所以,与c3p0的配|不?x)冲H?br /> <br /> <br /> Good Luck!<br /> Yours Matthew!<br /> <img src ="http://www.aygfsteel.com/xmatthew/aggbug/235332.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xmatthew/" target="_blank">x.matthew</a> 2008-10-19 21:19 <a href="http://www.aygfsteel.com/xmatthew/archive/2008/10/19/235332.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>源代码解读Spring+Hibernate(JPA)的LazyLoadException异常http://www.aygfsteel.com/xmatthew/archive/2008/10/11/233769.htmlx.matthewx.matthewSat, 11 Oct 2008 10:01:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/10/11/233769.htmlhttp://www.aygfsteel.com/xmatthew/comments/233769.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/10/11/233769.html#Feedback3http://www.aygfsteel.com/xmatthew/comments/commentRss/233769.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/233769.html     好久的笔C(jin)Q趁刚好休息整理文档Q翻?gu)一部分Q稍加整理后Q就发上来给大家׃n一下,希望对各位有所帮助?br />
    关于LazyLoadException异常Q用过Hibernate O/R Mapping工具的h应该都遇到过Q网上也是有很多解决的方案,其中Spring提供的一个方案就是在web.xml增加一个filter,CZ代码如下:

<filter>  
    
<filter-name>entityManager</filter-name>  
    
<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>  
</filter>  
  
<filter-mapping>  
    
<filter-name>entityManagerFilter</filter-name>  
    
<url-pattern>*.action</url-pattern>  
</filter-mapping> 

  解决办法有了(jin)Q接下来应该?x)有人好奇?x)q个配置filter后它是如何工作的Q?br />   下面来分析一下这个功能实现的源代? 不过之前Q比较重要的是了(jin)解,Z?x)出现l(f)azyload exception的异常发生?br />
   下面我模拟写?jin)一D代码,q段代码׃(x)发生该异?br />    注:(x)只是Z(jin)说明Q相关的代码q略了(jin)?br />
@Entity
public class Room {

 @Id
 @Column(length
=32)
 
private String id;

 @Column(length
=20)
 
private code;
 
 @OneToMany(mappedBy
="room"//default is use lazy load strategy 
 private Set desks;
}

@Entity
public class Desk {

     @Id
     @Column(length
=32)
     
private String id;
    
     @Column(length
=20)
     
private code;
     
     @ManyToOne
     
private Room root;

}

public class RoomSerivce {

    @Transactional(readOnly
=true)
    
public Room getRoomById(String roomId) {
      Assert.notBlank(roomId, 
"room'id is null);
        return getDao().findById(roomId);
    
    }

}


 1 public class RoomServiceTest {
 2 
 3     public static void main(String[] args[]) {
 4     
 5         //get service from spring beanfactory
 6         RoomService service = SpringContext.getSerivce("roomService");
 7         Assert.notNull(service, " roomService bean not exsit");
 8     
 9       Room room = service.getRoomById("1");
10       //here lazy exception throw out
11       Set Desks = room.getDesks();
12       CollectionsUtils.toString(Desks);
13     }
14 }

   分析q段代码Q我们不隑֏玎ͼ在RoomServiceTestq个试的例子中Q因Z用了(jin)ZAnnotation的声明性事务,所以在RoomSerivce.getRoomByIdҎ(gu)q行l束后,事务已l提交了(jin)。但CZ中Room实体与Desk实例的关pM用的是lazy fetch的策略,此时Room对象中的desks集合q是为空?br /> 当执行到下面两句?q才真正使用到desks集合?
  Set Desks = room.getDesks();
  CollectionsUtils.toString(Desks);
Hibernate׃(x)Ҏ(gu)原来lazy讑֮的方式,取EntityManagerQ?Ҏ(gu)它从数据库查?Desk实现的数据,q时上面我们已经提到Q事务已l随getRoomByIdҎ(gu)的运行结束提? EntityManager对象也已l关闭。此时再调用 EntityManager操作Q就?x)报EntityManager has been closed 异常(lazy load exception)

   ok, 清楚q块Q大家有时可能也猜想C(jin)Springq个解决Ҏ(gu)是怎么处理的了(jin)?br />    Spring的TransactionInterceptor 其就是通过AOP负责拦截着所有针对事务TransactionManager的操?
   q样Spring可以针对lazy异常q行拦截?jin)?br />
   清楚上面的后Q下面的代码是非常好理解?jin),来看一下OpenEntityManagerInViewFilter的代?
我加?jin)些注释Q大家很Ҏ(gu)明白:

 1     protected void doFilterInternal(
 2             HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
 3             throws ServletException, IOException {
 4 
 5       //通过WebApplicationContext,从Web服务中取得context实例后,Ҏ(gu)EntityManagerFactory.classcd
 6       //取得EntityManagerFacotry实例
 7         EntityManagerFactory emf = lookupEntityManagerFactory(request);
 8         boolean participate = false;
 9 
10         //如果?rn)态方法hasResource已经有EntityManagerFactory实例?jin),׃用再通过
11         //EntityManagerFactory创徏一个新EntityManger?/span>
12         if (TransactionSynchronizationManager.hasResource(emf)) {
13             // Do not modify the EntityManager: just set the participate flag.
14             participate = true;
15         }
16         else {
17             logger.debug("Opening JPA EntityManager in OpenEntityManagerInViewFilter");
18             try {
19             //通过EntityManagerFactory创徏一个新EntityManger,q过bindResourceҎ(gu)
20             //保存到TransactionSynchronizationManager?br /> 21             //q样Q通TransactionSynchronizationManager的getResourceҎ(gu)取得EntityMangerHolder
22                 EntityManager em = createEntityManager(emf);
23                 TransactionSynchronizationManager.bindResource(emf, new EntityManagerHolder(em));
24             }
25             catch (PersistenceException ex) {
26                 throw new DataAccessResourceFailureException("Could not create JPA EntityManager", ex);
27             }
28         }
29 
30         try {
31             filterChain.doFilter(request, response);
32         }
33 
34         finally {
35             if (!participate) {
36             //每次hl束后,把EntityManager关闭
37                 EntityManagerHolder emHolder = (EntityManagerHolder)
38                         TransactionSynchronizationManager.unbindResource(emf);
39                 logger.debug("Closing JPA EntityManager in OpenEntityManagerInViewFilter");
40                 EntityManagerFactoryUtils.closeEntityManager(emHolder.getEntityManager());
41             }
42         }
43     }
44    

    上面的代码就不用多解释了(jin)Q?到现在已l很清楚知道Spring针对 Hibernate的Lazy问题是怎么解决的?br />     当然我们可以扩展到除Web服务以外Q来实现解决lazy的问题?我们自己来管理TransactionSynchronizationManager可以了(jin))
   
    当然Spring针对 Hibernate(非JPA的实?原理也是一P只是它针对的SessionFactory,也是由TransactionSynchronizationManager来统一理?br />    
    最后如果大家如q有不清楚的Q欢q一赯论?br />    
Good Luck!
Yours Matthew!



x.matthew 2008-10-11 18:01 发表评论
]]>
Spring3.0新特?Restful support MVChttp://www.aygfsteel.com/xmatthew/archive/2008/09/02/226474.htmlx.matthewx.matthewTue, 02 Sep 2008 11:32:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/09/02/226474.htmlhttp://www.aygfsteel.com/xmatthew/comments/226474.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/09/02/226474.html#Feedback4http://www.aygfsteel.com/xmatthew/comments/commentRss/226474.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/226474.html
包括很多新功能,如标题中提到的Restful的支持,q有Servlet3.0的支持等?br /> 大概ȝ?jin)一下,Spring3.0中会(x)包括以下一些新Ҏ(gu)?
  • 1. Full scale REST support by means of additions to the Spring MVC API - already pretty detailed, and apparently going to be included in the first milestone release
  • 2. Support for Unified EL (as seen in Spring Web Flow) - very likely part of 3.0, but no details given
  • 3. Annotation support for declaring factory methods - as above
  • 4 .Support for Portlet 2.0 (JSR 286), including resource requests (ResourceServingPortlet) - as above
  • 5. "Preparations" for Servlet 3.0 specification - sounded a lot like architectural preparations not visible to the "consumer"
  • 6. Something to fill the gap between Spring Web Flow and Spring MVC - that sounded very vague
  • 7. Inclusion (probably generalisation) of the repeat, retry and resume semantics provided by Spring Batch - was only hinted at, no details given
  • 8. Inclusion of the OXM support provided by Spring WS - sounded pretty definitive, but no details given
  • 9. Some kind of site definition language for the web stack - no idea whether this is more than a rumour
  • 10. Model-based validation for use both in server and client - as above

下面我们具体介绍一下Restful该特?
  刚才我也提到?jin),Spring3.0是基于其目前提供的Spring MVC框架上引入对Rest的支持,q样使其可以很好的融合到Spring中?br />   下面有一D代码,大家看了(jin)?x)更有体会(x)?br />    先看一下如何发布Rest风格的服务接?br />
1 @RequestMapping(value = "/gadgets/{id}",
2       method = RequestMethod.GET)
3 public View getGadget(@PathParam String id) {
4   // 功能是根?id 查询 Gadget对象
5   // q回View对象
6 }
7 
   看到使用Annotation方式Q代码非常简z。@RequestMapping是对访求的资源进行服务的l定Q?value指定服务的资源\? method是指Rest风格中的CRUD的方法?br />    @PathParam是对资源路么参数的解?它会(x)自动Ҏ(gu)提交的数据格式,解析参数倹{?br />
   下面来看一?strong>RestTemplateQ对Rest服务接口的调?
 
 1 // 使用getForObject执行查询操作
 2 //  (指定参数提交方式)
 3 RestTemplate template = new RestTemplate();
 4 Gadget gadget = template.getForObject(
 5     "http://www.springify.com/gadgets/{id}",
 6     Gadget.class1);
 7 
 8 // 使用postForLocation 执行新增操作
 9 // (指定参数提交方式,使用Map对象)
10 Map<String, String> params =
11     new HashMap<String, String>();
12 params.put("id"42);
13 URI uri = template.postForLocation(
14     "http://www.springify.com/gadgets/{id}/features",
15     new Feature("Glows in the dark."), params);
16 
17 // 删除操作的演C?/span>
18 template.delete(
19     "http://www.springify.com/gadgets/{id}", someId);
20 
21
29 

ȝQ可以看C用Rest风格的服务发布,可以Ҏ(gu)务资源进行统一的管理,使用发布的接口更清晰?br />
当然在Spring 3.0 发布之前Q上q的APIQannotation可能?x)有变动Q我们也期待Spring能与我们早日见面?br />
最后,׃本h对Rest技术了(jin)解还不是太深入,也希望大家能多提些意见和?br />
Good Luck!
Yours Matthew!



x.matthew 2008-09-02 19:32 发表评论
]]>
hibernate-memcached--在Hibernate中用Memcached作ؓ(f)一个二U分布式~存http://www.aygfsteel.com/xmatthew/archive/2008/08/20/223293.htmlx.matthewx.matthewWed, 20 Aug 2008 08:43:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/08/20/223293.htmlhttp://www.aygfsteel.com/xmatthew/comments/223293.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/08/20/223293.html#Feedback11http://www.aygfsteel.com/xmatthew/comments/commentRss/223293.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/223293.html阅读全文

x.matthew 2008-08-20 16:43 发表评论
]]>
源代码解读Cas实现单点d(single sign out)功能实现原理http://www.aygfsteel.com/xmatthew/archive/2008/07/09/213808.htmlx.matthewx.matthewWed, 09 Jul 2008 14:44:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/07/09/213808.htmlhttp://www.aygfsteel.com/xmatthew/comments/213808.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/07/09/213808.html#Feedback13http://www.aygfsteel.com/xmatthew/comments/commentRss/213808.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/213808.html阅读全文

x.matthew 2008-07-09 22:44 发表评论
]]>
Spring Integration 学习(fn)W记(l?http://www.aygfsteel.com/xmatthew/archive/2008/05/28/195731.htmlx.matthewx.matthewWed, 28 May 2008 13:38:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/05/28/195731.htmlhttp://www.aygfsteel.com/xmatthew/comments/195731.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/05/28/195731.html#Feedback1http://www.aygfsteel.com/xmatthew/comments/commentRss/195731.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/195731.html     endpoint配置相对比较灉|Q下面再来看一个例子:(x)
        <endpoint input-channel="inputChannel"
              default-output-channel
="outputChannel"
              handler-ref
="helloService"
              handler-method
="sayHello"/>
      
<beans:bean id="helloService" class="org.springframework.integration.samples.helloworld.HelloService"/> 

1         public class HelloService {
2         
3             public String sayHello(String name) {
4                 return "Hello " + name;
5             }
6         }

 上面q个例子演CZ(jin)?HelloService配置成一个MessageEndpointlgQ消息从"inputChannel"队列接收后,
 调用HelloService.sayHelloҎ(gu)Q等sayHelloҎ(gu)q回后,Ҏ(gu)default-output-channel="outputChannel"的配|?br />  把返回的l果保存到message.payload属性后发送给"outputChannel"队列

也可Ҏ(gu)Annotation的方式,配置Ҏ(gu)如下Q?br />
    <annotation-driven/>
    
<message-bus auto-create-channels="true"/>
    
<context:component-scan base-package="org.springframework.integration.samples.helloworld"/>
    
    
<beans:bean id="helloService" class="org.springframework.integration.samples.helloworld.HelloService"/>

1 @MessageEndpoint(input="inputChannel", defaultOutput="outputChannel")
2 public class HelloService {
3 
4     @Handler
5     public String sayHello(String name) {
6             return "Hello " + name;
7     }
8 }

讄q发操作属?br /> xml配置Q?br />
<endpoint input-channel="exampleChannel" handler-ref="exampleHandler"/>
        
<!-- 讄q发讄 core核心(j)U程?nbsp;max最大线E数 queue-capacity 队列最大消息数 keep-alive idleU程生命旉-->
    
<concurrency core="5" max="25" queue-capacity="20" keep-alive="120"/>
</endpoint>


annotation配置
1 @MessageEndpoint(input="fooChannel")
2 @Concurrency(coreSize=5, maxSize=20, queueCapacity=20, keepAliveSeconds=120)
3 public class FooService {
4 
5     @Handler
6     public void bar(Foo foo) {
7         
8     }
9 }

下面ȝ一下常见的annotation的用方?br /> @MessageEndpoint
它表C处理消息对象的l端节点。一般与其它的元数据标记一起用?br /> 下面?x)具体介l与该元数据标记一起用的其它标识的用方法?br />
@MessageEndpoint源代码:(x)

 1 @Target(ElementType.TYPE)
 2 @Retention(RetentionPolicy.RUNTIME)
 3 @Inherited
 4 @Documented
 5 @Component
 6 public @interface MessageEndpoint {
 7 
 8     String input() default ""//接收消息的队列名U?/span>
 9     String defaultOutput() default ""//默认发送消息的队列名称(只有在不讄@Router情况下才有效)
10     int pollPeriod() default 0//发送消息的轮@旉间隔(只有在不讄@Router情况下才有效)
11 }

@Handler
消息回调处理的方法。与@MessageEndpoint一起配|?span style="color: red;">(只限M3版,M4以及(qing)后箋版本可以单独使用,具体使用Ҏ(gu)q要{具体的实现出来)Q收到input队列的消息后Q回调@Handler标识的方?br /> 回调Ҏ(gu)的参数类型必Mmessage.payload属性类型相?br /> 注:(x)如果回调Ҏ(gu)有返回? 则回调方法处理完成后Q会(x)返回D|到message.payload属性后Q?br /> 发送消息到@MessageEndpoint的defaultOutput队列。如果defaultOutput没有讑֮Q则抛出异常?br />
@Handler源代码:(x)

1 @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
2 @Retention(RetentionPolicy.RUNTIME)
3 @Inherited
4 @Documented
5 public @interface Handler {
6 
7 }

下面的例子演CZ(jin)Q从"channel1"队列接收消息后由@Handler标记的方法处理。消息的payload属性值的cd必须与方法的参数cd相同
1 @MessageEndpoint(input="channel1")
2 public class FooService {
3 
4     @Handler
5     public void bar(Foo foo) {
6         
7     }
8 }


@Polled
必须与@MessageEndPoint 一起用。但也可以与@Router,@Splitter标识配合使用Q后面再分别举例说明?br /> @Polled 用于开启一个轮循的方式调用Ҏ(gu)的功?br /> 它有三个参数Q?br />     period: 轮@旉间隔(单位:微秒) 默认?1000
    initialDelay:  轮@延迟旉(单位:微秒) 默认?
    fixedRate: 默认为false
   
@Polled 源代?br />
 1 @Target(ElementType.METHOD)
 2 @Retention(RetentionPolicy.RUNTIME)
 3 @Inherited
 4 @Documented
 5 public @interface Polled {
 6     int period() default 1000;
 7     long initialDelay() default PollingSchedule.DEFAULT_INITIAL_DELAY;
 8     boolean fixedRate() default PollingSchedule.DEFAULT_FIXED_RATE;
 9 
10 
 
   
下面来看几个例子Q?br /> 例子1:
 1 @MessageEndpoint(defaultOutput="outputChannel")
 2 public class Counter {
 3 
 4     private AtomicInteger count = new AtomicInteger();
 5 
 6     @Polled(period=3000)
 7     public int getNumber() {
 8         return count.incrementAndGet();
 9     }
10 }  

q个例子功能是,MessageBus启动后,由@Polled标记 ?U触发getNumberҎ(gu)Q当getNumberҎ(gu)q回后,
把返回D|到message.payload属性后Q发送到outputChannel队列中?br />

例子2:
 1 @MessageEndpoint
 2 public class Counter {
 3 
 4     private AtomicInteger count = new AtomicInteger();
 5 
 6     @Polled(period=3000)
 7     public int getNumber() {
 8         return count.incrementAndGet();
 9     }
10 
11     @Router
12     public String resolveChannel(int i) {
13         if (i % 2 == 0) {
14             return "even";
15         }
16         return "odd";
17     }
18 }   

q个例子功能是,MessageBus启动后,由@Polled标记 ?U触发getNumberҎ(gu), 当getNumberҎ(gu)q回?
׃resolveChannelҎ(gu)讄?jin)@Router 标识Q则把有getNumberҎ(gu)q回值都?x)传lresolveChannelҎ(gu)Q最?br /> ?x)根据方法的q回?即队列名U? (@Router标记功能)Q把消息发到even队列或是odd队列

注:(x)如果@MessageEndpointcMQ在Ҏ(gu)上标C(jin)@Router标记后,@MessageEndpoint的defaultOutput变成无效了(jin)?/span>

@Splitter
必须与@MessageEndPoint 一起用?br /> 该元数据标识用于分解消息内容Q它所在的Ҏ(gu)的返回值必L一个集?collection).如果集合元素不是Messagecd
但发送时Q自动把集合中的元素对象保存到Message.payload属性后发送。集合中有多个元素Q则?x)发送多次消息?br />
1 @Target(ElementType.METHOD)
2 @Retention(RetentionPolicy.RUNTIME)
3 @Documented
4 @Handler
5 public @interface Splitter {
6     String channel(); //消息发送的队列?/span>
7 }


下面两个例子实现效果是一L(fng)
例子1
 1 @MessageEndpoint(input="inputChannel")
 2 public class HelloService {
 3 
 4    @Splitter(channel="outputChannel")
 5     public List<String> sayHello(String name) {
 6         String s =  "Hello " + name;
 7         List<String> list = new ArrayList<String>();
 8         list.add(s);
 9         return list;
10     }
11 }
12 

例子2
 1 @MessageEndpoint(input="inputChannel")
 2 public class HelloService {
 3 
 4    @Splitter(channel="outputChannel")
 5     public List<Message> sayHello(String name) {
 6         String s =  "Hello " + name;
 7         List<Message> list = new ArrayList<Message>();
 8         Message message = new GenericMessage<String>(s);
 9         list.add(message);
10         return list;
11     }
12 }


@Router
消息队列路由功能?必须与@MessageEndPoint 一起用?br /> 它所在的Ҏ(gu)的返回值类型必LMessageChannle或是String(channel name)cd
具体的例子参考上面?br />
@Publisher
必须与@MessageEndPoint 一起用?br /> 说明Q@Publisher 标识是根?after-returning 切面的AOP 在方面返回值时Q发送消息到指定消息队列 .    

下面的例子:(x)说明 fooҎ(gu)调用后,q回g(x)发送到fooChannel消息队列
1 @Publisher(channel="fooChannel")
2 public String foo() {
3     return "bar";
4 }
 

@Subscriber 
必须与@MessageEndPoint 一起用?br /> 接收指定队列的消息内宏V它实现的异步的消息监听事g?br /> 一旦有消息接收刎ͼ则会(x)Ҏ(gu)message.payload g为参敎ͼ回调@Subscriber 标识标记的方?br />
1 @Subscriber(channel="fooChannel")
2 public void log(String foo) {
3     System.out.println(foo);
4 }


Good Luck!
Yours Matthew!
2008q??4?br />





x.matthew 2008-05-28 21:38 发表评论
]]>
Spring Integration 学习(fn)W记http://www.aygfsteel.com/xmatthew/archive/2008/05/28/193542.htmlx.matthewx.matthewWed, 28 May 2008 03:49:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/05/28/193542.htmlhttp://www.aygfsteel.com/xmatthew/comments/193542.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/05/28/193542.html#Feedback6http://www.aygfsteel.com/xmatthew/comments/commentRss/193542.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/193542.html阅读全文

x.matthew 2008-05-28 11:49 发表评论
]]>
JAAS学习(fn)W记http://www.aygfsteel.com/xmatthew/archive/2008/05/28/195180.htmlx.matthewx.matthewWed, 28 May 2008 01:27:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/05/28/195180.htmlhttp://www.aygfsteel.com/xmatthew/comments/195180.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/05/28/195180.html#Feedback2http://www.aygfsteel.com/xmatthew/comments/commentRss/195180.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/195180.html阅读全文

x.matthew 2008-05-28 09:27 发表评论
]]>
Spring 2.5 配置文档帮助卡片http://www.aygfsteel.com/xmatthew/archive/2008/05/23/202307.htmlx.matthewx.matthewFri, 23 May 2008 00:51:00 GMThttp://www.aygfsteel.com/xmatthew/archive/2008/05/23/202307.htmlhttp://www.aygfsteel.com/xmatthew/comments/202307.htmlhttp://www.aygfsteel.com/xmatthew/archive/2008/05/23/202307.html#Feedback2http://www.aygfsteel.com/xmatthew/comments/commentRss/202307.htmlhttp://www.aygfsteel.com/xmatthew/services/trackbacks/202307.html 该卡片提供比较详l介l了(jin)spring2.5 xml的配|?包括以下四部?br />
  • XML elements available as of Spring 2.5(Spring2.5 xml标签配置)
  • Most commonly used elements(常用的xml标签使用Ҏ(gu))
  • NamespacesQ命名空?
  • Guide to Spring’s rich set of annotations(Spring支持的annotations技术用指?

 官方下蝲地址

下面是官方发布的内容的原?http://www.springframework.org/node/660
DZone has just published a reference card for Spring 2.5 Configuration. The card was written by the very knowledgeable Craig Walls and provides exhaustive details about all the XML configuration options for your Spring 2.5 contexts. It provides a handy desktop reference for any developer building Spring powered applications. XML averse developers should also check out the options in Spring 2.5 for annotation based configuration.



x.matthew 2008-05-23 08:51 发表评论
]]>
վ֩ģ壺 ư| ƶ| ״| | | | | | ¹| | կ| | | Դ| | | ˳ƽ| | ѧ| ƽ| | | | ۲| ʹ| ɽ| | ͬ| | ӥ̶| Ƥɽ| ʡ| | | | | ʤ| ̶| | ƽ| Ұ|