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