1 import ch.ethz.prose.DefaultAspect;2 import ch.ethz.prose.crosscut.Crosscut;3 import ch.ethz.prose.crosscut.CatchCut;4 import ch.ethz.prose.crosscut.REST;5 import ch.ethz.prose.filter.Exceptions;6 import ch.ethz.prose.filter.Within;7 import ch.ethz.prose.filter.PointCutter;8 import ch.ethz.prose.crosscut.MissingInformationException;9 10 /**11 * Class ExampleCatchAspect12 *13 * @version $Revision: 1.2 $14 * @author Angela Nicoara15 */16 17 public class ExampleCatchAspect extends DefaultAspect18 {19 public Crosscut c = new CatchCut()20 {21 public void CATCH_ARGS()22 {23 System.err.println(" ->advice: the exception was caught");24 }25 26 protected PointCutter pointCutter()27 {28 return ( Exceptions.type("TestException3$") );29 //return ( Exceptions.type("TestException.*") .AND (Exceptions.subtypeOf(java.lang.RuntimeException.class) ) );30 //return ( Exceptions.type("TestException.*") .AND (Within.method("baz")) .OR (Within.method("bar")) );31 //return ( Exceptions.type("TestException.*") .AND (Within.method("barbaz")) .AND (Exceptions.subtypeOf(java.lang.RuntimeException.class)) );32 //return ( Exceptions.type("TestException.*") .AND (Exceptions.withMessage("21")) );33 //return ( Exceptions.type("TestException.*") .OR (Within.method("bar|baz")) ); 34 //return ( Exceptions.type("TestException.*") .AND (Within.method("bar|baz")) ); 35 //return ( Exceptions.type("TestException.*") .AND (Within.method("bar")) ); 36 //return ( Exceptions.type("TestException.*") );37 //return ( Exceptions.withMessage("21") );38 }39 };40 }