|
SSISO Community검색 |
|
SSISO Community메뉴 |
|
SSISO Community카페 |
|
블로그 카테고리 |
|
|
spring로 검색한 결과 |
|
등록일:2008-06-10 17:18:34 작성자: 제목:AOP 예제2 - Before Advice |
|
package com.youngkun.aoptest;
import java.lang.reflect.Method;
import org.springframework.aop.MethodBeforeAdvice; import org.springframework.aop.framework.ProxyFactory;
public class SimpleBeforeAdvice implements MethodBeforeAdvice{ public static void main(String[] args){ MessageWriter target = new MessageWriter(); ProxyFactory pf = new ProxyFactory(); pf.addAdvice(new SimpleBeforeAdvice()); pf.setTarget(target); MessageWriter proxy = (MessageWriter)pf.getProxy(); proxy.writeMessage(); } public void before(Method method, Object[] args, Object target) throws Throwable{ System.out.println("Before method: "+ method.getName()); } } 실행 결과
Before method: writeMessage 자기야
출처 : http://youngkun.info/93 |
|
|
|
|
|