Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] questions after looking at decompiled code.

Hi,
Below is a copy of some weaved code. I hope someone would have some answers for the following questions which have been raised after viewing the decompiled code.
The code was written and compiled using the Eclipse plug-in for AspectJ. It was decompiled using JAD decompiler.
1.Does the import statements to aspectj libraries mean the weaved code includes the runtime libraries of AspectJ as shown in the decompiled code below.Is there any way where we can have the aspect replace the point cuts with pure java code and refrain from keeping aspect specific code within the final byte code. As this may mean we would have to include the runtime libraries in a final product release that uses aspects.
2.Based on the decompiled code ,when we have to replace a method but still keep the parameters, does aspectJ first create objects for the parameters and assign the values and then pass them into the new method weaved in by aspectJ.
3.Are there any known memory leaks and performance issues induced by aspects.
Any comments would be appreciated.
Trishan
 
<<<code>>>
import com.edocs.core.logging.Loggers;
import java.io.PrintStream;
import org.apache.log4j.Category;
import org.aspectj.runtime.internal.AroundClosure;
import org.aspectj.runtime.reflect.Factory;
 
public class AspectLoggerTestbed
{
 
    public static final org.aspectj.lang.JoinPoint.StaticPart ajc$tjp_0;
    public static final org.aspectj.lang.JoinPoint.StaticPart ajc$tjp_1;
 
    public AspectLoggerTestbed()
    {
    }
 
    public static void someMethod2()
    {
        System.out.println("some Method 2 Executed");
    }
 
    public static void someMethod()
    {
        int dummyO;
        SimpleExampleLogging.aspectOf().ajc$before$SimpleExampleLogging$3ee(ajc$tjp_1);
        String s = "Old Logger Argument";
        FakeLogCall_aroundBody1$advice(s, InterceptingArgs.aspectOf(), s, null);
        System.out.println("Some method running");
        dummyO = 10;
        System.out.println("DummyO:" + dummyO);
        dummyO /= 0;
          goto _L1
        SimpleExampleLogging.aspectOf().ajc$before$SimpleExampleLogging$531(ajc$tjp_0);
        Exception exception;
        exception;
_L1:
    }
 
    static final void FakeLogCall_aroundBody0(String s)
    {
        TestCalls.FakeLogCall(s);
    }
 
    static final void FakeLogCall_aroundBody1$advice(InterceptingArgs this, String LogText, AroundClosure ajc_aroundClosure, AroundClosure aroundclosure)
    {
        Loggers.assessLogger(LogText.getClass()).info("from replaced method ::" + ajc_aroundClosure);
    }
 
    static
    {
        Factory factory = new Factory("AspectLoggerTestbed.java", Class.forName("AspectLoggerTestbed"));
        ajc$tjp_0 = factory.makeSJP("exception-handler", factory.makeCatchClauseSig("0--AspectLoggerTestbed-java.lang.Exception-<missing>-"), 69);
        ajc$tjp_1 = factory.makeSJP("method-execution", factory.makeMethodSig("9-someMethod-AspectLoggerTestbed----void-"), 49);
    }
}
 
<<<<<code>>>>>
------------------------------------------------------------------------------------
Trishan de Lanerolle
R&D
AOP Research Group
SL ATC, Virtusa
www.virtusa.com
tlanerolle@xxxxxxxxxxx
 

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If the reader of this message is not the intended recipient, you are hereby notified that your access is unauthorized, and any review, dissemination, distribution or copying of this message including any attachments is strictly prohibited. If you are not the intended recipient, please contact the sender and delete the material from any computer.

 
 

Back to the top