Hi Owen,

 

This indicates that the before advice is in fact applying in your test.
Could it be that you aren't seeing log output because the
Log4jExecutionTracing aspect traces to a log4j logger at debug level, and
that you need to enable debug output in your log4j configuration? 

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Owen Corpening
Sent: Wednesday, October 15, 2008 4:24 PM
To: aspectj-users@eclipse.org
Subject: Re: [aspectj-users] question on ajlib:

 

Well it seems to have put the Traced interface on my DummyObject class ...

 

Description  Resource Path Location Type

Extending interface set for type 'com.AjlibTest.DummyObject'
(DummyObject.java) to include
'org.codehaus.ajlib.util.tracing.Log4jExecutionTracing$Traced'
(TestTraceAspect.aj)  aspectLib        Unknown  Java Problem

Join point 'constructor-execution(void com.AjlibTest.DummyObject.<init>())'
in Type 'com.AjlibTest.DummyObject' (DummyObject.java:2) advised by
afterReturning advice from 'com.AjlibTest.TestTraceAspect'
(ExecutionTracing.aj:56) [with runtime test]    aspectLib        Unknown
Java Problem

Join point 'constructor-execution(void com.AjlibTest.DummyObject.<init>())'
in Type 'com.AjlibTest.DummyObject' (DummyObject.java:2) advised by
afterThrowing advice from 'com.AjlibTest.TestTraceAspect'
(ExecutionTracing.aj:76) [with runtime test]    aspectLib        Unknown
Java Problem

Join point 'constructor-execution(void com.AjlibTest.DummyObject.<init>())'
in Type 'com.AjlibTest.DummyObject' (DummyObject.java:2) advised by before
advice from 'com.AjlibTest.TestTraceAspect' (ExecutionTracing.aj:45) [with
runtime test]   aspectLib        Unknown  Java Problem

Join point 'method-execution(int com.AjlibTest.DummyObject.someMethod(int))'
in Type 'com.AjlibTest.DummyObject' (DummyObject.java:4) advised by
afterReturning advice from 'com.AjlibTest.TestTraceAspect'
(ExecutionTracing.aj:51) [with runtime test]    aspectLib        Unknown
Java Problem

Join point 'method-execution(int com.AjlibTest.DummyObject.someMethod(int))'
in Type 'com.AjlibTest.DummyObject' (DummyObject.java:4) advised by
afterThrowing advice from 'com.AjlibTest.TestTraceAspect'
(ExecutionTracing.aj:76) [with runtime test]    aspectLib        Unknown
Java Problem

Join point 'method-execution(int com.AjlibTest.DummyObject.someMethod(int))'
in Type 'com.AjlibTest.DummyObject' (DummyObject.java:4) advised by before
advice from 'com.AjlibTest.TestTraceAspect' (ExecutionTracing.aj:45) [with
runtime test]   aspectLib        Unknown  Java Problem

 

 

----- Original Message ----
From: Andy Clement <[EMAIL PROTECTED]>
To: aspectj-users@eclipse.org
Sent: Wednesday, October 15, 2008 12:44:55 PM
Subject: Re: [aspectj-users] question on ajlib:

Hi Owen,

 

Does compiling with -showWeaveInfo show whether your declare parents is or
is not working?

 

Andy.

2008/10/15 Owen Corpening <[EMAIL PROTECTED]>

Probably a syntactical error, the before() in Log4jExecutionTracing never
gets executed, I bet my "declare parents" isn't right, first time I ever
came across that, I guess I haven't been keeping up with aj1.5:

 

package com.AjlibTest;

import org.codehaus.ajlib.util.tracing.Log4jExecutionTracing;

public aspect TestTraceAspect extends Log4jExecutionTracing {

    declare parents: com.AjlibTest.DummyObject implements Traced;

}

 

my package looks like this:

./com/AjlibTest/DummyObject.java

./com/AjlibTest/HelloWorld.java

./com/AjlibTest/TestTraceAspect.aj

 

Anyone see my goof?

 

thanks,

owen

 

----- Original Message ----
From: Ron Bodkin <[EMAIL PROTECTED]>
To: aspectj-users@eclipse.org

Sent: Tuesday, October 14, 2008 12:00:12 AM
Subject: RE: [aspectj-users] question on ajlib:

Hi Owen,

 

Traced is a protected interface that is defined within Log4jExecutionTracing
itself. You just use the aspect by extending it and using declare parents to
make the relevant classes you want to trace implement traced, as in:

 

public aspect MyLog4jExecutionTracing extends Log4jExecutionTracing {

     declare parents: com.bigboxco.myapp..* implements Traced;

}

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Owen Corpening
Sent: Thursday, October 09, 2008 6:41 AM
To: aspectj-users@eclipse.org
Subject: [aspectj-users] question on ajlib:

 

With regards to ajlib:

http://fisheye.codehaus.org/browse/ajlib-incubator/org.codehaus.ajlib

 

There is a class Log4jExecutionTracing not covered in the unit tests and for
which there are no examples of its usage. It uses a class called "Traced"
that I don't see anywhere and I *think* that is at the core of my not
comprehending how to use this class.

 

Basically if I have a test tracing aspect like this it works great
(DummyObject is the class whose methods are to be traced):

 

package com.AjlibTest;

import org.codehaus.ajlib.util.tracing.ExecutionTracing;

public aspect TestTraceAspect extends ExecutionTracing

{

    public pointcut scope() : within(DummyObject);

    before(): scope()

    {

         System.out.println("Tracing");

    }

}

 

But if I change ExecutionTracing to Log4jExecutionTracing it doesn't weave
anything (advice defined in com.AjlibTest.TestTraceAspect has not been
applied [Xlint:adviceDidNotMatch]).

 

much appreciated,

Owen

 

 

 


_______________________________________________
aspectj-users mailing list
aspectj-users@eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users

 

 

_______________________________________________
aspectj-users mailing list
aspectj-users@eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to