1 17 18 package org.objectweb.jac.aspects.tracing; 19 20 import org.aopalliance.intercept.ConstructorInvocation; 21 import org.aopalliance.intercept.MethodInvocation; 22 import org.objectweb.jac.core.*; 23 24 public class RecordingWrapper extends Wrapper { 25 public RecordingWrapper(AspectComponent ac) { 26 super(ac); 27 } 28 29 public Object record(Interaction interaction) { 30 Object ret = proceed(interaction); 31 if(Recorder.get().isRecording()) { 32 Recorder.get().recordMethodCall(interaction.wrappee, 33 interaction.method.getName(), 34 interaction.args); 35 } 36 return ret; 37 } 38 39 public Object invoke(MethodInvocation invocation) throws Throwable { 40 return record((Interaction)invocation); 41 } 42 public Object construct(ConstructorInvocation invocation) throws Throwable { 43 return record((Interaction)invocation); 44 } 45 } 46 | Popular Tags |