Package examples.exception

Source Code of examples.exception.ExceptionHandlingAspect

package examples.exception;

import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
import org.codehaus.aspectwerkz.joinpoint.CatchClauseRtti;

/**
* @author <a href="mailto:jboner@codehaus.org">Jonas Bon�r</a>
*/
public class ExceptionHandlingAspect {

    /**
     * before handler(java.lang.Exception) && withincode(public static void examples.exception.Target.main(String[]))
     *
     * @Before handler(java.lang.Exception) && within(examples.exception.Target)
     */
    public void logEntry(final JoinPoint joinPoint) throws Throwable {
        CatchClauseRtti rtti = (CatchClauseRtti)joinPoint.getRtti();
        Exception e = (Exception)rtti.getParameterValue();
        System.out.println("[From advice] exception catched:" + e.toString());
    }
}
TOP

Related Classes of examples.exception.ExceptionHandlingAspect

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.