123456789101112131415161718192021 |
- package com.lovecoding.aop;
- import com.lovecoding.SpringConfig;
- import org.springframework.context.annotation.AnnotationConfigApplicationContext;
- public class TestAop {
- public static void main(String[] args) {
- AnnotationConfigApplicationContext context =
- new AnnotationConfigApplicationContext(SpringConfig.class);
- // CounterAop bean = context.getBean(CounterAop.class);
- // bean.add( 5, 5 );
- // bean.sub( 10, 5 );
- Counter bean = context.getBean("countterImpl", Counter.class);
- //bean.add(5, 5);
- bean.sub(5, 5);
- }
- }
|