package com.ghs.aop.test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.ghs.aop.Sleepable;
public class TestAOP {
public static void main(String[] args) {
// method1();
// method2();
// method3();
method4();
}
private static void method1() {
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext1.xml");
Sleepable sleeper = (Sleepable) context.getBean("humanProxy");
sleeper.sleep();
}
private static void method2() {
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext2.xml");
Sleepable sleeper = (Sleepable) context.getBean("human");
sleeper.sleep();
}
private static void method3() {
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext3.xml");
Sleepable sleeper = (Sleepable) context.getBean("human");
sleeper.sleep();
}
private static void method4() {
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext4.xml");
Sleepable sleeper = (Sleepable) context.getBean("human");
sleeper.sleep();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
AOPTest.zip (40个子文件)
AOPTest
bin
applicationContext2.xml 1KB
log4j.properties 781B
applicationContext1.xml 2KB
com
ghs
aop
SleepHelper.class 1KB
Human.class 522B
test
TestAOP.class 1KB
SleepHelper4.class 1KB
SleepHelper2.class 641B
Sleepable.class 133B
applicationContext4.xml 975B
applicationContext3.xml 1KB
.settings
org.eclipse.jdt.core.prefs 598B
src
applicationContext2.xml 1KB
log4j.properties 781B
applicationContext1.xml 2KB
com
ghs
aop
SleepHelper4.java 590B
test
TestAOP.java 1KB
Sleepable.java 80B
SleepHelper2.java 228B
SleepHelper.java 580B
Human.java 156B
applicationContext4.xml 975B
applicationContext3.xml 1KB
.project 383B
.classpath 2KB
lib
slf4j-api-1.6.0.jar 25KB
org.springframework.context-3.0.5.RELEASE.jar 653KB
aspectjrt-1.8.4.jar 115KB
log4j-1.2.12.jar 350KB
org.springframework.beans-3.0.5.RELEASE.jar 542KB
org.springframework.expression-3.0.5.RELEASE.jar 166KB
commons-logging-1.6.0.jar 17KB
org.springframework.asm-3.0.5.RELEASE.jar 52KB
com.springsource.org.aopalliance-1.0.0.jar 5KB
org.springframework.core-3.0.5.RELEASE.jar 373KB
aspectjweaver-1.8.4.jar 1.78MB
org.springframework.aop-3.0.5.RELEASE.jar 314KB
org.springframework.context.support-3.0.5.RELEASE.jar 99KB
org.springframework.aspects-3.0.5.RELEASE.jar 35KB
slf4j-log4j12-1.6.0.jar 10KB
共 40 条
- 1
资源评论
- lzg4062015-11-29第四种方式没跑成功,需要添加cglib的jar包,添加了cglib-nodep-2.2.3,测试通过
爱上香锅的麻辣
- 粉丝: 143
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功