Mar 17

Tomcat源码分析(序)

 

转眼工作已经快10年了,娃也2岁了,最近大半年在试着转型,从纯开发向管理方向转,不是很顺,且这半年多代码写的比较少了,找不到前面两三年年的那种亢奋的感觉了,经常能为了搞掂一个点,一泡尿能憋一上午。所以私下里总想着找个流行的开源框架来读读,尝试过去读flume的代码,读的让人觉得恶心,flume的PMC chairman是个阿三,不是怎么喜欢阿三,读了几天,事情一多就没有坚持下去了,主要还是后来用的少了,也没什么动力去读了。还是回归质朴,读读tomcat这种不是那么花哨的东西,速度不用很快,坚持读下去,相信应该是有用的。而且据说tomcat 7 以后的代码重构的已经比较清爽了,不像之前那么杂乱无章的,让人摸不着头脑,看起来应该会读的比较舒服吧。

Dec 06

Nested method invoke in the same instance issue of Spring AOP

    Today, Spring AOP is widely used in transaction manage, but I found something that I had never noticed yet.
    The situation was :  I have a service class named KeywordExtendService , there are 2 methods in it named: "start" and "service". the service method will invoke the start method. but I config the pointcut like : execution(* com.waynewan.KeywordExtendService .start(..)) .  and the transaction propagation level is "REQUIRED",  so this means if there is an transaction it will use the exist one, if not it will create one. but the result is not as I guessed. when the start method invoked in the service method(no transaction configuration), there is no transaction start.  Continue reading