1 package org.objectweb.jac.samples.bench; 2 3 import org.aopalliance.intercept.ConstructorInvocation; 4 import org.aopalliance.intercept.MethodInvocation; 5 import org.objectweb.jac.core.AspectComponent; 6 import org.objectweb.jac.core.Wrapper; 7 import org.objectweb.jac.core.Interaction; 8 9 public class NullAC extends AspectComponent { 10 11 19 20 public void wrap( 21 int n, 22 String wrappeeExpr, 23 String wrappeeClassExpr, 24 String wrappeeMethodExpr) { 25 for (; n > 0; n--) { 26 pointcut( 27 wrappeeExpr, 28 wrappeeClassExpr, 29 wrappeeMethodExpr, 30 NullWrapper.class.getName(), 31 "doProceed", 32 null, 33 false); 34 } 35 } 36 37 public class NullWrapper extends Wrapper { 38 public NullWrapper(AspectComponent ac) { 39 super(ac); 40 } 41 public Object doProceed(Interaction interaction) { 42 return proceed(interaction); 44 } 45 public Object invoke(MethodInvocation invocation) throws Throwable { 46 return doProceed((Interaction) invocation); 47 } 48 public Object construct(ConstructorInvocation invocation) 49 throws Throwable { 50 return doProceed((Interaction) invocation); 51 } 52 } 53 } 54 | Popular Tags |