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 import java.util.*; 24 import org.objectweb.jac.core.dist.*; 25 26 31 32 public class DebuggingWrapper extends Wrapper { 33 34 35 public Debugger debugger = null; 36 37 42 public DebuggingWrapper(AspectComponent ac) { 43 super(ac); 44 debugger = (Debugger) NameRepository.get().getObject("debugger0"); 45 if (debugger == null) { 46 debugger = new Debugger(); 47 } 48 } 49 50 58 59 public Object step(Interaction interaction) { 60 61 String wrappeeName = 62 (String ) NameRepository.get().getName(interaction.wrappee); 63 debugger.startOfMethod( 64 Distd.getLocalContainerName(), 65 wrappeeName, 66 interaction.method.getName(), 67 interaction.args); 68 Date d1 = new Date(); 69 Object ret = proceed(interaction); 70 Date d2 = new Date(); 71 72 debugger.endOfMethod( 73 Distd.getLocalContainerName(), 74 wrappeeName, 75 interaction.method.getName(), 76 interaction.args, 77 ret, 78 d2.getTime() - d1.getTime()); 79 80 return ret; 81 } 82 83 public Object invoke(MethodInvocation invocation) throws Throwable { 84 return step((Interaction) invocation); 85 } 86 87 public Object construct(ConstructorInvocation invocation) 88 throws Throwable { 89 return step((Interaction) invocation); 90 } 91 92 } 93 | Popular Tags |