/* * Created on Sep 12, 2003 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package com.aop; import org.aspectj.lang.JoinPoint; /** * @author rdifrang * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public aspect ExceptionHandler { pointcut classList() : within(com.regular..*) || within(com.capitalone..*); before(Throwable e) : classList() && handler(*) && args(e) { System.out.println("Starting before block"); log(thisJoinPointStaticPart, e); System.out.println("End of before block"); } private void log(JoinPoint.StaticPart jp, Throwable e) { System.out.println("Class Name: " + jp.getSignature().getDeclaringType()); System.out.println("Error Message" + e.getMessage() ); } }