锘??xml version="1.0" encoding="utf-8" standalone="yes"?>校园亚洲春色另类小说合集,亚洲精品高清国产麻豆专区,综合久久久久久中文字幕亚洲国产国产综合一区首http://www.tkk7.com/Good-Game/category/26410.htmlzh-cnSat, 10 May 2008 06:02:41 GMTSat, 10 May 2008 06:02:41 GMT60spring 涓?hibernate 鏁村悎(浜嬪姟)http://www.tkk7.com/Good-Game/archive/2008/05/09/199477.htmlG_GG_GFri, 09 May 2008 05:47:00 GMThttp://www.tkk7.com/Good-Game/archive/2008/05/09/199477.htmlhttp://www.tkk7.com/Good-Game/comments/199477.htmlhttp://www.tkk7.com/Good-Game/archive/2008/05/09/199477.html#Feedback0http://www.tkk7.com/Good-Game/comments/commentRss/199477.htmlhttp://www.tkk7.com/Good-Game/services/trackbacks/199477.htmlhttp://doc.javanb.com/spring-framework-reference-zh-2-0-5/ch09.html

鍏堜粠閰嶇疆鏂囦歡寮濮嬶細
婧愮爜錛?a href="/Files/Good-Game/springAop.rar">springAop.rar

闇瑕乯ar
<?xml聽version="1.0"聽encoding="UTF-8"?>
<classpath>
聽聽聽聽
<classpathentry聽kind="src"聽path="java"/>
聽聽聽聽
<classpathentry聽kind="con"聽path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/aspectjrt.jar"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/aspectjweaver.jar"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/spring.jar"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/spring-sources.jar"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/commons-logging-1.0.4.jar"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/cglib-nodep-2.1_3.jar"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/hibernate3.jar"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/log4j-1.2.11.jar"/>
聽聽聽聽
<classpathentry聽kind="con"聽path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/dom4j-1.6.1.jar"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/commons-collections-2.1.1.jar"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/mysql.jar"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/jta.jar"/>
聽聽聽聽
<classpathentry聽kind="lib"聽path="lib/antlr-2.7.6.jar"/>
聽聽聽聽
<classpathentry聽kind="output"聽path="bin"/>
</classpath>


spring 閰嶇疆
<?xml聽version="1.0"聽encoding="UTF-8"?>
<beans聽xmlns="http://www.springframework.org/schema/beans"
聽聽聽聽聽聽聽xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
聽聽聽聽聽聽聽xmlns:aop
="http://www.springframework.org/schema/aop"
聽聽聽聽聽聽聽xmlns:tx
="http://www.springframework.org/schema/tx"
聽聽聽聽聽聽聽xsi:schemaLocation
="
聽聽聽聽聽聽聽http://www.springframework.org/schema/beans聽http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
聽聽聽聽聽聽聽http://www.springframework.org/schema/tx聽http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
聽聽聽聽聽聽聽http://www.springframework.org/schema/aop聽http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
>
聽聽聽聽聽聽聽
聽聽
聽聽
<!--聽daoCalss聽:聽extends聽HibernateDaoSupport聽implements聽BeanDao聽-->
聽聽
<bean聽id="beanDao"聽class="dao.imp.BeanDaoImp">
聽聽聽聽聽聽
<property聽name="sessionFactory">
聽聽聽聽聽聽聽聽聽聽
<ref聽bean="sessionFactory"></ref>
聽聽聽聽聽聽
</property>
聽聽
</bean>
聽聽
聽聽聽
聽聽聽
<!--聽hibernate3聽sessionFactory聽-->
聽聽聽
<bean聽id="sessionFactory"聽聽聽聽聽
聽聽聽聽聽聽聽聽class
="org.springframework.orm.hibernate3.LocalSessionFactoryBean">聽聽
聽聽聽 聽聽聽
<!-- spring 涓?hibernate 鑱旂郴 -->
聽聽聽聽聽聽聽
<property聽name="configLocation"聽value="classpath:hibernate.cfg.xml"/>聽聽
聽聽聽
</bean>聽聽
聽聽聽
聽聽聽
<!--聽aop聽涓庝簨鍔¤仈緋宦燼opBean<->txAdvice聽聽-->
聽聽聽
<aop:config>
聽聽聽聽聽聽聽聽聽聽聽
<!--聽閫昏緫鎷︽埅聽-->
聽聽聽聽聽聽聽聽聽
<aop:pointcut聽id="aopBean"聽expression="execution(*聽*.*.*(..))"/>
聽聽聽聽聽聽聽聽聽聽聽
<aop:advisor聽advice-ref="txAdvice"聽pointcut-ref="aopBean"/>
聽聽聽聽聽聽
</aop:config>

聽聽聽聽
<!--聽浜嬪姟閫傞厤鍣?/span>-->
聽聽聽聽聽聽聽
<bean聽id="txManager"聽class="org.springframework.orm.hibernate3.HibernateTransactionManager">
聽聽聽聽聽聽
<property聽name="sessionFactory"聽ref="sessionFactory"/>
聽聽聽聽
</bean>

聽聽聽聽
<!--聽浜嬪姟鍘熷瓙聽鍏蜂綋鏂規硶榪涜浠涔堜簨鍔÷?/span>-->
聽聽聽聽聽聽
<tx:advice聽id="txAdvice"聽transaction-manager="txManager">
聽聽聽聽聽聽聽聽聽聽聽
<tx:attributes>
聽聽聽聽聽聽聽聽聽聽聽聽聽
<tx:method聽name="get*"聽read-only="true"/>
聽聽聽聽聽聽聽聽聽聽
<tx:method聽name="*"/>
聽聽聽聽聽聽聽聽
</tx:attributes>
聽聽聽聽聽聽
</tx:advice>

</beans>


hibernate 閰嶇疆
<?xml聽version="1.0"聽encoding="UTF-8"?>
<!DOCTYPE聽hibernate-configuration聽PUBLIC
聽聽聽聽聽聽聽聽"-//Hibernate/Hibernate聽Configuration聽DTD聽3.0//EN"
聽聽聽聽聽聽聽聽"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
>
<hibernate-configuration>
<session-factory聽name="asdf">
聽聽聽聽
<property聽name="hibernate.dialect">mysql</property>
聽聽聽聽
<property聽name="myeclipse.connection.profile">
聽聽聽聽聽聽聽聽com.mysql.jdbc.Driver
聽聽聽聽
</property>
聽聽聽聽
<property聽name="connection.url">
聽聽聽聽聽聽聽聽jdbc:mysql://localhost/aop
聽聽聽聽
</property>
聽聽聽聽
<property聽name="show_sql">true</property>
聽聽聽聽
聽聽聽聽
<property聽name="connection.username">root</property>
聽聽聽聽
<property聽name="connection.password"></property>
聽聽聽聽
<property聽name="connection.driver_class">
聽聽聽聽聽聽聽聽com.mysql.jdbc.Driver
聽聽聽聽
</property>
聽聽聽聽
<property聽name="dialect">
聽聽聽聽聽聽聽聽org.hibernate.dialect.MySQLDialect
聽聽聽聽
</property>
聽聽聽聽
聽聽聽聽
<mapping聽resource="bean/UnitBean.hbm.xml"/>
聽聽聽聽
</session-factory>
</hibernate-configuration>


dao 綾伙紙鎺ュ彛錛?br />
package聽dao.imp;

import聽java.util.List;

import聽org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import聽bean.UnitBean;

import聽dao.BeanDao;

publicclass聽BeanDaoImp聽extends聽HibernateDaoSupport聽implements聽BeanDao{
聽聽聽聽
publicvoid聽addBean(UnitBean聽unitBean)聽{
聽聽聽聽聽聽聽聽
this.getHibernateTemplate().save(unitBean);
聽聽聽聽}

聽聽聽聽
public聽List<UnitBean>聽getBeanByAll()聽{
聽聽聽聽聽聽聽聽
returnthis.getHibernateTemplate().find("聽from聽"+UnitBean.class.getName());
聽聽聽聽}

聽聽聽聽
publicvoid聽removeBean(long聽beanId)聽{
聽聽聽聽聽聽聽聽
this.getHibernateTemplate().delete(
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽getHibernateTemplate().get(UnitBean.
class,聽beanId)
聽聽聽聽聽聽聽聽聽聽聽聽);
聽聽聽聽}
聽聽聽聽
}

Main 綾?br />
package聽unit;

import聽org.springframework.context.ApplicationContext;
import聽org.springframework.context.support.ClassPathXmlApplicationContext;

import聽dao.BeanDao;
import聽bean.UnitBean;

publicclass聽Main聽{
聽聽聽聽
publicstaticvoid聽main(String[]聽args)聽{
聽聽聽聽聽聽聽聽聽聽聽ApplicationContext聽ctx聽
=new聽ClassPathXmlApplicationContext("beans.xml");
聽聽聽聽聽聽聽聽聽聽聽BeanDao聽dao聽
=聽(BeanDao)聽ctx.getBean("beanDao");
聽聽聽聽聽聽聽聽聽聽聽UnitBean聽bean聽
=new聽UnitBean();
聽聽聽聽聽聽聽聽聽聽聽bean.setName(
"xx");
聽聽聽聽聽聽聽聽聽聽聽bean.setPass(
"11");
聽聽聽聽聽聽聽聽聽聽聽dao.addBean(bean);
聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽
for(UnitBean聽unitBean聽:聽dao.getBeanByAll()聽){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println(聽unitBean.getId()聽);
聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽dao.removeBean(bean.getId());
聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽}
}
緇撴灉錛?br />Hibernate: insert into bean (name, pass) values (?, ?)
Hibernate: select unitbean0_.id as id0_, unitbean0_.name as name0_, unitbean0_.pass as pass0_ from bean unitbean0_
1
Hibernate: select unitbean0_.id as id0_0_, unitbean0_.name as name0_0_, unitbean0_.pass as pass0_0_ from bean unitbean0_ where unitbean0_.id=?
Hibernate: delete from bean where id=?








G_G 2008-05-09 13:47 鍙戣〃璇勮
]]>
spring AspectJ 鍩烘湰浣跨敤http://www.tkk7.com/Good-Game/archive/2008/05/08/199146.htmlG_GG_GThu, 08 May 2008 02:08:00 GMThttp://www.tkk7.com/Good-Game/archive/2008/05/08/199146.htmlhttp://www.tkk7.com/Good-Game/comments/199146.htmlhttp://www.tkk7.com/Good-Game/archive/2008/05/08/199146.html#Feedback0http://www.tkk7.com/Good-Game/comments/commentRss/199146.htmlhttp://www.tkk7.com/Good-Game/services/trackbacks/199146.htmlspring 瀹為檯浣跨敤 錛堣繖灝變嬌鐢ㄤ竴涓緥瀛愯鏄庯級

嫻嬭瘯綾諱互鍙婄粨鏋滐細
package聽unit;

import聽org.springframework.context.ApplicationContext;
import聽org.springframework.context.support.ClassPathXmlApplicationContext;

import聽bean.HelloService;

publicclass聽Main聽{
聽聽聽聽
publicstaticvoid聽main(String[]聽args)聽{
聽聽聽聽聽聽聽聽聽聽聽ApplicationContext聽context聽
=new聽ClassPathXmlApplicationContext(聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
"beans.xml");聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽HelloService聽service聽
=聽(HelloService)聽context.getBean("helloService");聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽service.annotationAop();
聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽System.out.println();
聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽service.xmlAop();
聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽}
}
緇撴灉錛?/b>
聽annotationAop//姝e父鏂規硶榪愯
aop--AspectJ!聽//
annotation鎷︽埅

聽xmlAop
//姝e父鏂規硶榪愯
aop--XmlAop! //閰嶇疆鎷︽埅



use jar
  • --aspectjrt.jar
  • --aspectjweaver.jar
  • --acglib-nodep-2.1_3.jar
  • --commons-logging.jar
  • --spring.jar
  • --spring-aspects.jar
XML閰嶇疆
<beans聽xmlns="http://www.springframework.org/schema/beans"聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
聽聽聽聽聽聽聽聽聽聽聽聽xmlns:aop
="http://www.springframework.org/schema/aop"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽xsi:schemaLocation
=聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽"http://www.springframework.org/schema/beans聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽http://www.springframework.org/schema/beans/spring-beans.xsd聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽http://www.springframework.org/schema/aop聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽http://www.springframework.org/schema/aop/spring-aop.xsd"
>
聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽
<!--聽嫻嬭瘯浣跨敤綾宦犲垎鍒敱聽鏂規硶聽annotationAop/xmlAop聽-->
聽聽聽聽聽聽聽聽
<bean聽id="helloService"聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽class
="bean.HelloService"/>聽聽聽聽
聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽
<!--聽annotation聽aop聽鎷︽埅聽浣跨敤@Aspect聽
聽聽聽聽聽聽聽聽聽聽聽聽@Pointcut("execution(*聽annotationAop(..))")聽聽
聽聽聽聽聽聽聽聽聽聽聽聽@AfterReturning("mainMethod()")聽聽
聽聽聽聽聽聽聽聽
-->
聽聽聽聽聽聽聽聽
<bean聽id="xmlAop"
聽聽聽聽聽聽聽聽聽聽聽聽class
="aop.AnnotationAspectJ"/>
聽聽聽聽聽聽聽聽
<aop:aspectj-autoproxy/>聽聽聽聽
聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽
<!--聽xml聽aop聽聽閰嶇疆鏂囦歡鎷︽埅聽-->
聽聽聽聽聽聽聽聽
<bean聽id="XmlAspectJ"聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽class
="aop.XmlAspectJ"/>
聽聽聽聽聽聽聽聽
<aop:config>聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽
<aop:aspect聽ref="XmlAspectJ">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<aop:pointcut聽id="mainMethod"聽expression="execution(*聽xmlAop(..))"/>聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<aop:after-returning聽pointcut-ref="mainMethod"聽method="goXmlAop"/>聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽
</aop:aspect>聽聽聽
聽聽聽聽聽聽聽聽聽
</aop:config>聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽
</beans>

HelloService.java
package聽bean;

publicclass聽HelloService聽{聽聽
聽聽聽聽
publicvoid聽annotationAop()聽{聽聽聽聽
聽聽聽聽聽聽聽聽System.out.println(
"聽annotationAop聽");
聽聽聽聽}
聽聽聽聽
聽聽聽聽
publicvoid聽xmlAop(){
聽聽聽聽聽聽聽聽System.out.println(
"聽xmlAop聽");
聽聽聽聽}
}

AnnotationAspectJ.java
package聽aop;

import聽org.aspectj.lang.annotation.AfterReturning;
import聽org.aspectj.lang.annotation.Aspect;
import聽org.aspectj.lang.annotation.Pointcut;

@Aspect
publicclass聽AnnotationAspectJ聽{聽聽
聽聽聽聽@Pointcut(
"execution(*聽annotationAop(..))")聽聽
聽聽聽聽
publicvoid聽mainMethod()聽{}聽聽
聽聽聽聽
聽聽聽聽@AfterReturning(
"mainMethod()")聽聽
聽聽聽聽
publicvoid聽sayHello()聽{聽聽聽聽
聽聽聽聽聽聽聽聽System.out.println(
"aop--AspectJ!");聽聽
聽聽聽聽}
}

XmlAspectJ.java
package聽aop;

publicclass聽XmlAspectJ聽{
聽聽聽聽
publicvoid聽goXmlAop(){
聽聽聽聽聽聽聽聽System.out.println(
"聽aop--XmlAop!聽");
聽聽聽聽}
}















G_G 2008-05-08 10:08 鍙戣〃璇勮
]]>
spring 瀛︿範絎旇http://www.tkk7.com/Good-Game/archive/2007/12/21/169359.htmlG_GG_GFri, 21 Dec 2007 08:33:00 GMThttp://www.tkk7.com/Good-Game/archive/2007/12/21/169359.htmlhttp://www.tkk7.com/Good-Game/comments/169359.htmlhttp://www.tkk7.com/Good-Game/archive/2007/12/21/169359.html#Feedback0http://www.tkk7.com/Good-Game/comments/commentRss/169359.htmlhttp://www.tkk7.com/Good-Game/services/trackbacks/169359.htmlspring欏圭洰鍩烘湰闇瑕乯ar->commons-logging.jar;log4j-1.2.9.jar;spring.jar
鍙傝冿細http://www.redsaga.com/spring_ref/2.0/html/beans.html

鏈枃涓昏鍐呭錛?/font>
1.鍗曞閰嶇疆鏂囦歡鐨勪嬌鐢?br />2.鍔ㄦ佹浛鎹㈢被鏂規硶錛坈glib錛?br />3.
鑷畾涔変綔鐢ㄥ煙bean
4.瀹氬埗bean鐗規?br />

1).鍗曞閰嶇疆鏂囦歡鐨勪嬌鐢?/font>
1.1)閰嶇疆鏂囦歡:beans.xml鏍煎紡錛堝熀鏈厤緗級
<?xml聽version="1.0"聽encoding="UTF-8"?>
<!DOCTYPE聽beans聽PUBLIC聽"-//SPRING//DTD聽BEAN//EN"聽
聽聽聽聽"http://www.springframework.org/dtd/spring-beans.dtd"
>
<beans>
聽聽聽聽
<bean聽id="userBean"聽name="userBean"
聽聽聽聽聽聽聽聽聽聽class
="springtest.UserBean"
聽聽聽聽聽聽聽聽聽聽abstract
="false"
聽聽聽聽聽聽聽聽聽聽singleton
="true"
聽聽聽聽聽聽聽聽聽聽lazy-init
="default"
聽聽聽聽聽聽聽聽聽聽autowire
="default"
聽聽聽聽聽聽聽聽聽聽dependency-check
="default">
聽聽聽聽聽聽聽聽聽聽聽聽
<property聽name="name">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<value>bea</value>
聽聽聽聽聽聽聽聽聽聽聽聽
</property>
聽聽聽聽
</bean>
聽聽聽聽
</beans>

spring 宸ュ巶寤虹珛鍗曢厤緗拰澶氶厤緗枃浠?br />
聽聽聽 //鍗曢厤緗枃浠跺姞杞?/font>
聽聽聽 public
void聽testSp()throws聽Exception{
聽聽聽聽聽聽聽聽Resource聽res聽
=new聽FileSystemResource(
聽聽聽聽聽聽聽聽聽聽聽聽
this.getClass().getClassLoader().getResource("config/beans.xml").getPath()
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽);
聽聽聽聽聽聽聽聽BeanFactory聽fac聽
=new聽XmlBeanFactory(res);
聽聽聽聽聽聽聽聽UserBean聽uu聽
=聽(UserBean)聽fac.getBean("userBean");
聽聽聽聽聽聽聽聽System.out.println(uu.getName());
聽聽聽聽聽聽聽聽System.out.println(uu.getAge());
聽聽聽聽}
聽聽聽 //澶氶厤緗枃浠跺姞杞?/font>
聽聽聽聽publicvoid聽testSps()聽throws聽Exception聽{
聽聽聽聽聽聽聽聽ApplicationContext聽act
=new聽ClassPathXmlApplicationContext(
聽聽聽 聽聽聽 聽聽聽
new聽String[]聽{"config/beans.xml",.....}
聽聽聽 聽聽聽 );
聽聽聽聽聽聽聽聽UserBean聽uu聽
=聽(UserBean)act.getBean("userBean");
聽聽聽聽聽聽聽聽System.out.println(聽uu.getName());
聽聽聽聽}
1.2) 榪樼敤涓縐嶆槸鍗曢厤緗<import resource="銆?xml"/>杈懼埌澶氶厤緗?br />
<?xml聽version="1.0"聽encoding="UTF-8"?>
<!DOCTYPE聽beans聽PUBLIC聽"-//SPRING//DTD聽BEAN//EN"聽
聽聽聽聽"http://www.springframework.org/dtd/spring-beans.dtd"
>
<beans>
聽聽聽聽
<import聽resource="beans_2.xml"/>
聽聽聽聽
<bean聽id="userBean"聽name="userBean"
聽聽聽聽聽聽聽聽聽聽class
="springtest.UserBean"
聽聽聽聽聽聽聽聽聽聽abstract
="false"
聽聽聽聽聽聽聽聽聽聽singleton
="true"
聽聽聽聽聽聽聽聽聽聽lazy-init
="default"
聽聽聽聽聽聽聽聽聽聽autowire
="default"
聽聽聽聽聽聽聽聽聽聽dependency-check
="default">
聽聽聽聽聽聽聽聽聽聽聽聽
<property聽name="name">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<ref聽聽bean="str1"/>
聽聽聽聽聽聽聽聽聽聽聽聽
</property>
聽聽聽聽
</bean>
</beans>

鍔犺澆灝辯敤涓婄殑 -銆?/span>鍗曢厤緗枃浠跺姞杞?/font>

2).鍔ㄦ佹浛鎹㈢被鏂規硶錛坈glib錛?/font>
閰嶇疆鏂囦歡涓?鏇挎崲鏂規硶(鏇挎崲鏂規硶 getName ) lib涓姞鍏?cglib.jar
<?xml聽version="1.0"聽encoding="UTF-8"?>
<!DOCTYPE聽beans聽PUBLIC聽"-//SPRING//DTD聽BEAN//EN"聽
聽聽聽聽"http://www.springframework.org/dtd/spring-beans.dtd"
>
<beans>
聽聽聽聽
<import聽resource="beans_2.xml"/>
聽聽聽聽
<bean聽id="userBean"聽name="userBean"
聽聽聽聽聽聽聽聽聽聽class
="springtest.UserBean"
聽聽聽聽聽聽聽聽聽聽abstract
="false"
聽聽聽聽聽聽聽聽聽聽singleton
="true"
聽聽聽聽聽聽聽聽聽聽lazy-init
="default"
聽聽聽聽聽聽聽聽聽聽autowire
="default"
聽聽聽聽聽聽聽聽聽聽dependency-check
="default">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<replaced-method聽name="getName"聽replacer="rm">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<arg-type>String</arg-type>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽
</replaced-method>

聽聽聽聽聽聽聽聽聽聽聽聽
<property聽name="name">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<ref聽聽bean="str1"/>
聽聽聽聽聽聽聽聽聽聽聽聽
</property>
聽聽聽聽
</bean>
聽聽聽聽
聽聽聽聽
<bean聽id="rm"聽class="springtest.ReplacedMethod"/>
</beans>

springtest.ReplacedMethod綾?br />
package聽springtest;

import聽java.lang.reflect.Method;

import聽org.springframework.beans.factory.support.MethodReplacer;

publicclass聽ReplacedMethod聽implements聽MethodReplacer聽{
聽聽聽聽
聽聽聽聽
public聽Object聽reimplement(Object聽arg0,聽Method聽arg1,聽Object[]聽arg2)聽throws聽Throwable聽{
聽聽聽聽聽聽聽聽
return"鍒樺嚡姣?/span>";
聽聽聽聽}
}

緇撴灉錛?涓嶇浣犳庝箞setName getName鍑烘潵鐨勯兘鏄?銆?鈥滃垬鍑瘏鈥?br />
3.鑷畾涔変綔鐢ㄥ煙bean 闇瑕乯dk1.5


4.瀹氬埗bean鐗規?br />
1錛夊垵濮嬪寲鍥炶皟 <bean id=".." class=".." init-method="init"/> 鏂規硶init()
聽 鍜?緇ф壙org.springframework.beans.factory.InitializingBean 瀹炵幇鎺ュ彛鏂規硶
聽聽聽 void afterPropertiesSet() throws Exception; 涓鏍?br />2錛?br />


G_G 2007-12-21 16:33 鍙戣〃璇勮
]]>
涓烘垜瀛︿範 Spring AOP 鍑嗗錛圥roxy錛?/title><link>http://www.tkk7.com/Good-Game/archive/2007/10/09/151302.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Tue, 09 Oct 2007 03:13:00 GMT</pubDate><guid>http://www.tkk7.com/Good-Game/archive/2007/10/09/151302.html</guid><wfw:comment>http://www.tkk7.com/Good-Game/comments/151302.html</wfw:comment><comments>http://www.tkk7.com/Good-Game/archive/2007/10/09/151302.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.tkk7.com/Good-Game/comments/commentRss/151302.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Good-Game/services/trackbacks/151302.html</trackback:ping><description><![CDATA[涓烘垜鍑嗗瀛︿範鍜岀悊瑙pring <br />鐗圭暀涓嬩唬鐮佺瑪璁幫細<br /><font color="#ffa500">鍙傝冿細</font><br /><font color="#0000ff">http://dev.csdn.net/author/labile/e70c97cb7f504d35b7b5350e7810cc5a.html</font><br /><font color="#ffa500">浠g爜鎰熸兂錛?br />聽聽聽 <font color="#000000">娌′釜鏂規硶閮芥垨澶氭垨灝戦渶瑕佺幆澧冨弬鏁?濡? jdbc鐨刢onn ,hbn鐨剆ession...絳夌瓑 )錛屾柟娉曠粨鏉熷悗鍙堣鍏抽棴銆?br />浣曚笉鐢╬roxy浠g悊騫剁敤閰嶇疆鏂囦歡鐨勬柟娉曟潵 鍏?寮session 絳?br />濡傦細<font color="#ff1493">浠ヤ笅鏄垜鐨勬兂娉曞茍涓嶆槸瀹為檯鍙敤</font><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);"><b><font color="#ffa500">閰嶇疆錛?/font></b><br /><</span><span style="color: rgb(128, 0, 0);">class聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="</span><font color="#ffa500"><font color="#000000"><font><font><font color="#ffa500"><font color="#000000"><span style="color: rgb(0, 0, 255);">HelloWorldImpl</span></font></font></font></font></font></font><font color="#0000ff"><span style="color: rgb(0, 0, 0);"></span></font><span style="color: rgb(0, 0, 255);">"</span><span style="color: rgb(0, 0, 255);">><br />聽 </span><font><font><font color="#ffa500"><font color="#000000"><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">function聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="set*"</span><span style="color: rgb(0, 0, 255);"> /></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><br /><br /></span></font></font></font></font><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">聽 <</span><span style="color: rgb(128, 0, 0);">function聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="getName"</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><font><font><font color="#ffa500"><font color="#000000"><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">proxyBegin artt="name"</span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="liukaiyi"</span><span style="color: rgb(0, 0, 255);">/> <br />聽聽聽 聽聽聽 <font color="#006400">//浣跨敤Proxy鏉ヨ祴鍊?name閭e湪瀹炵幇浠g爜涓氨鍙互涓嶇敤鍘誨叧娉ㄨ薄 session 絳夊睘鎬х殑寮鍏充簡 <br />聽聽聽 聽聽聽 //proxy涓厤緗笅 錛?鍦ㄥ疄鐜扮被涓?灝變嬌鐢?灝卞彲浠ヤ簡 </font></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></span></font></font></font></font><br /><span style="color: rgb(0, 0, 255);">聽聽聽 <</span><span style="color: rgb(128, 0, 0);">proxyBegin聽</span><span style="color: rgb(255, 0, 0);">ref</span><span style="color: rgb(0, 0, 255);">="HelloWorldHandler.doBefter"</span><span style="color: rgb(255, 0, 0);">聽args</span><span style="color: rgb(0, 0, 255);">="null"</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);">proxyEnd聽</span><span style="color: rgb(255, 0, 0);">ref</span><span style="color: rgb(0, 0, 255);">="HelloWorldHandler.doAfter"</span><span style="color: rgb(255, 0, 0);">聽args</span><span style="color: rgb(0, 0, 255);">="null"</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);">function</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">聽 <</span><span style="color: rgb(128, 0, 0);">function聽</span><span style="color: rgb(0, 0, 255);">=聽name="sayHelloWorld"><br /></span><span style="color: rgb(255, 0, 0);">聽聽聽 <proxyEnd聽ref</span><span style="color: rgb(0, 0, 255);">="HelloWorldHandler.doAfter"</span><span style="color: rgb(255, 0, 0);">聽args</span><span style="color: rgb(0, 0, 255);">="null"</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);">function</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);">class</span><span style="color: rgb(0, 0, 255);">><br /><br /><b><font color="#ffa500">浠g爜錛?/font></b><br /></span><font color="#ffa500"><font color="#000000"><font><font><font color="#ffa500"><font color="#000000"><span style="color: rgb(0, 0, 255);">HelloWorld hw = </span></font></font></font></font></font></font><span style="color: rgb(0, 0, 255);">(</span><font><font><font color="#ffa500"><font color="#000000"><span style="color: rgb(0, 0, 255);">HelloWorld</span></font></font></font></font><span style="color: rgb(0, 0, 255);">)Factory.getBean(</span><font><font><font color="#ffa500"><font color="#000000"><span style="color: rgb(0, 0, 255);">"HelloWorldImpl"</span></font></font></font></font><span style="color: rgb(0, 0, 255);">);<br />hw.getName();<br /><br /><b><font color="#ffa500">緇撴灉鏄細</font></b><br />before method invoke!<br />鍒樺嚡姣?br />after method invoke!<br /></span></div>鍦ㄦ 鎴戝彧鏄兂璞★紝spring 榪樻病鏈夌湅錛屼絾鎴戣涓簊pring 榪欎釜钁楀悕鐨勬鏋跺簲璇ュ湪榪欐柟闈㈡湁寰堝ソ鐨勫疄鐜般?br /><br /><b><font color="#ffa500">瀹為檯浠g爜錛?font color="#ff1493">甯屾湜spring鍙互鍚戞垜涓婇潰鐨勬柟娉曢厤緗ソ鐢ㄦ潵鍙栦唬涓嬮潰鐨勫疄闄呬唬鐮?^_^</font></font></b><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);">package</span><span style="color: rgb(0, 0, 0);">聽test.proxy;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽java.lang.reflect.InvocationHandler;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽java.lang.reflect.Method;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽java.lang.reflect.Proxy;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽junit.framework.TestCase;<br /><br /></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽TestProxy聽</span><span style="color: rgb(0, 0, 255);">extends</span><span style="color: rgb(0, 0, 0);">聽TestCase聽{<br />聽聽聽聽<br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽setUp()聽</span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);">聽Exception聽{<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">super</span><span style="color: rgb(0, 0, 0);">.setUp();<br />聽聽聽聽}<br />聽聽聽聽<br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽testProxy(){<br />聽聽聽聽聽聽聽聽聽聽聽聽聽HelloWorld聽hw聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽HelloWorldImpl();聽聽聽聽聽聽聽聽聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽InvocationHandler聽handler聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽HelloWorldHandler(hw);聽聽聽聽聽聽聽聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽HelloWorld聽proxy聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(HelloWorld)聽Proxy.newProxyInstance(聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽hw.getClass().getClassLoader(),聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽hw.getClass().getInterfaces(),聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽handler);聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽proxy.sayHelloWorld();<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println();<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽proxy.setName(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">liukaiyi</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽proxy.getName();<br />聽聽聽聽}<br />聽聽聽聽<br />}<br /><br /></span><span style="color: rgb(0, 0, 255);">interface</span><span style="color: rgb(0, 0, 0);">聽HelloWorld聽{聽聽聽<br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽sayHelloWorld()聽;聽聽聽<br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽getName();<br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽setName(String聽name);<br />}<br /><br /></span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽HelloWorldImpl聽</span><span style="color: rgb(0, 0, 255);">implements</span><span style="color: rgb(0, 0, 0);">聽HelloWorld聽{聽聽聽<br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">聽String聽name聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">""</span><span style="color: rgb(0, 0, 0);">;<br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽setName(String聽name)聽{<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.name聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽name;<br />聽聽聽聽}<br /><br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽sayHelloWorld()聽{聽聽聽<br />聽聽聽聽聽聽聽聽System.out.println(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Hello聽World!</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);聽聽聽聽聽聽聽聽聽聽聽聽聽聽<br />聽聽聽聽}<br /><br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽getName()聽{<br />聽聽聽聽聽聽聽聽System.out.println(</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.name);<br />聽聽聽聽}聽聽聽<br />}<br /><br /></span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽HelloWorldHandler聽</span><span style="color: rgb(0, 0, 255);">implements</span><span style="color: rgb(0, 0, 0);">聽InvocationHandler聽{聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">瑕佷唬鐞嗙殑鍘熷瀵硅薄聽聽聽</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">聽Object聽objOriginal;聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);">聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽*聽鏋勯犲嚱鏁般偮犅?br />聽聽聽聽聽聽聽聽聽聽聽聽聽*聽</span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);">聽obj聽瑕佷唬鐞嗙殑鍘熷瀵硅薄銆偮犅?br />聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);">聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽HelloWorldHandler(Object聽obj)聽{聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.objOriginal聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽obj聽;聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽}聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽Object聽invoke(Object聽proxy,聽Method聽method,聽Object[]聽args)聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);">聽Throwable聽{聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽Object聽result聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">聽;聽聽聽聽聽聽聽聽聽聽聽聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽String聽meName聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽method.getName();<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(meName.indexOf(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">set</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)</span><span style="color: rgb(0, 0, 0);">>-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">聽){<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">聽method.invoke(</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.objOriginal聽,args);聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(聽meName.equals(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">getName</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)聽){<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">鏂規硶璋冪敤涔嬪墠聽聽聽</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽doBefore();聽</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">浠夸經鏄疉OP鐨勫獎瀛愶紝鍛靛懙聽聽聽</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">璋冪敤鍘熷瀵硅薄鐨勬柟娉暵犅犅?/span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽result聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽method.invoke(</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.objOriginal聽,args);聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">鏂規硶璋冪敤涔嬪悗聽聽聽</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽doAfter();聽聽聽聽聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">聽result聽;聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽}聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽doBefore()聽{聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">before聽method聽invoke!</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽}聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽doAfter()聽{聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">after聽method聽invoke!</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽}聽聽聽<br />聽聽聽聽聽}聽聽聽<br /></span></div><br /><br /></font></font><font color="#ffa500">緇撴灉錛?br /><font color="#000000">Hello World!<br />after method invoke!<br /><br />before method invoke!<br />鍒樺嚡姣?br />after method invoke!<br /></font><br /></font><img src ="http://www.tkk7.com/Good-Game/aggbug/151302.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Good-Game/" target="_blank">G_G</a> 2007-10-09 11:13 <a href="http://www.tkk7.com/Good-Game/archive/2007/10/09/151302.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://shzzhsy.com" target="_blank">一级成人a免费视频</a>| <a href="http://haohaoshuo.com" target="_blank">18禁美女裸体免费网站</a>| <a href="http://chinashineway.com" target="_blank">亚洲中文字幕无码一区</a>| <a href="http://chinacmk.com" target="_blank">免费视频成人片在线观看</a>| <a href="http://wwwpaogou123.com" target="_blank">亚洲人成黄网在线观看</a>| <a href="http://www52a.com" target="_blank">免费观看日本污污ww网站一区</a>| <a href="http://nblfkj.com" target="_blank">国产在线播放线91免费</a>| <a href="http://sdkjkj.com" target="_blank">亚洲综合校园春色</a>| <a href="http://ksp33.com" target="_blank">在线观看亚洲天天一三视</a>| <a href="http://cnkaiertong.com" target="_blank">黄网站色在线视频免费观看</a>| <a href="http://99rlcf.com" target="_blank">免费在线观看自拍性爱视频</a>| <a href="http://626632.com" target="_blank">久久久久亚洲av无码专区导航</a>| <a href="http://yeyaweiban.com" target="_blank">永久免费观看的毛片的网站</a>| <a href="http://nxjyyj.com" target="_blank">免费看成人AA片无码视频吃奶</a>| <a href="http://hbqueena.com" target="_blank">亚洲综合激情五月丁香六月</a>| <a href="http://cjfuli.com" target="_blank">亚洲小说区图片区另类春色</a>| <a href="http://jhc2go.com" target="_blank">成人黄页网站免费观看大全</a>| <a href="http://517fanfan.com" target="_blank">最近更新免费中文字幕大全</a>| <a href="http://www003924.com" target="_blank">亚洲中文字幕AV每天更新</a>| <a href="http://010youhua.com" target="_blank">亚洲理论电影在线观看</a>| <a href="http://121fj.com" target="_blank">日本无吗免费一二区</a>| <a href="http://50077995.com" target="_blank">亚洲精品tv久久久久久久久</a>| <a href="http://d8139.com" target="_blank">成人一a毛片免费视频</a>| <a href="http://0967c.com" target="_blank">久久精品成人免费看</a>| <a href="http://mqiuxia66.com" target="_blank">午夜亚洲国产精品福利</a>| <a href="http://023439.com" target="_blank">亚洲美免无码中文字幕在线</a>| <a href="http://lyjhjx.com" target="_blank">亚洲精品无码日韩国产不卡?V</a>| <a href="http://6609929.com" target="_blank">很黄很色很刺激的视频免费</a>| <a href="http://www-60060.com" target="_blank">西西人体免费视频</a>| <a href="http://sdzntg.com" target="_blank">免费国产va在线观看</a>| <a href="http://cztbm.com" target="_blank">中文日韩亚洲欧美制服</a>| <a href="http://kelingdq.com" target="_blank">久久亚洲精精品中文字幕</a>| <a href="http://0359jgyy.com" target="_blank">狠狠亚洲婷婷综合色香五月排名</a>| <a href="http://xuexilo.com" target="_blank">永久免费看mv网站入口</a>| <a href="http://www-3499.com" target="_blank">99热在线精品免费全部my</a>| <a href="http://grjeans.com" target="_blank">中文字幕免费在线观看</a>| <a href="http://4eeyy.com" target="_blank">成人无码WWW免费视频</a>| <a href="http://http99.com" target="_blank">kk4kk免费视频毛片</a>| <a href="http://99880524.com" target="_blank">亚洲hairy多毛pics大全</a>| <a href="http://cjfuli.com" target="_blank">亚洲无限乱码一二三四区</a>| <a href="http://51comcomcom.com" target="_blank">国产亚洲精久久久久久无码</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>