Can't see advice being applied [message #655997] |
Wed, 23 February 2011 16:59 |
|
Hi,
I'm making my first steps with ApsectJ and AJDT. Not very successful so far ;-(
In my workspace I have plugin projects with my source code and I added an "aspects" project (also a plugin). I added one aspect:
package aspects;
import org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision;
public aspect Universe
{
before() : execution(* BaseCDORevision.*(..)) { bang(); }
private static void bang() { System.err.println("=== BANG! ==="); }
}
The AJDT Event Trace view shows this:
17:55:34 ============================================================ ===============================
17:55:34 Build kind = AUTOBUILD
17:55:34 Project=aspects, kind of build requested=Incremental AspectJ compilation
17:55:34 Timer event: 0ms: Flush included source file cache
17:55:34 Timer event: 0ms: Check delta
17:55:34 File: C:\develop\ws\aspectj\aspects\src\aspects\Universe.aj has changed.
17:55:34 build: Examined delta - 1 changed, 0 added, and 0 deleted source files in required project aspects
17:55:34 Timer event: 1ms: Looking for and marking configuration changes in aspects
17:55:34 Configuration changes found: true
17:55:34 Timer event: 1ms: Look for source/resource changes
17:55:34 Setting list of classpath elements with modified contents:
17:55:34 [C:/develop/ws/aspectj/plugins/org.eclipse.net4j.tcp/bin, C:/develop/ws/aspectj/plugins/org.eclipse.net4j.util/bin, C:/develop/ws/aspectj/plugins/org.eclipse.net4j/bin, C:/develop/ws/aspectj/plugins/org.eclipse.emf.cdo.server/bin , C:/develop/ws/aspectj/plugins/org.eclipse.emf.cdo.common/bin , C:/develop/ws/aspectj/plugins/org.eclipse.emf.cdo.server.net 4j/bin]
17:55:34 Timer event: 46ms: Pre compile
17:55:34 Sending the following configuration changes to the compiler: []
17:55:34 1 source file changes since last build
17:55:34 Compiler configuration for project aspects has been read by compiler. Resetting.
17:55:34 Configuration was []
17:55:34 Resetting list of modified source files. Was [C:\develop\ws\aspectj\aspects\src\aspects\Universe.aj]
17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.net4j.tcp\bin
17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.net4j.tcp\bin' is apparently unchanged so not performing timestamp check
17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.net4j.util\bin
17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.net4j.util\bin' is apparently unchanged so not performing timestamp check
17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.net4j\bin
17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.net4j\bin' is apparently unchanged so not performing timestamp check
17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.server\bin
17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.server\bi n' is apparently unchanged so not performing timestamp check
17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.common\bin
17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.common\bi n' is apparently unchanged so not performing timestamp check
17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.server.net 4j\bin
17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.server.ne t4j\bin' is apparently unchanged so not performing timestamp check
17:55:34 Preparing for build: planning to be an incremental build
17:55:34 Starting incremental compilation loop 1 of possibly 5
17:55:34 Timer event: 303ms: Time to first compiled message
17:55:34 Dropping back to full build
17:55:34 Preparing for build: not going to be incremental because no successful previous full build
17:55:35 Timer event: 735ms: Time to first woven message
17:55:35 AspectJ reports build successful, build was: FULL
17:55:35 AJDE Callback: finish. Was full build: true
17:55:35 Timer event: 1588ms: Total time spent in AJDE
17:55:35 Timer event: 0ms: Refresh after build
17:55:35 Types affected during build = 1133
17:55:35 Timer event: 1638ms: Total time spent in AJBuilder.build()
17:55:35 Timer event: 5ms: Delete markers: aspects (Finished deleting markers for aspects)
17:55:35 Timer event: 0ms: Create markers: aspects (Finished creating markers for aspects)
17:55:35 Created 0 markers in 1 files
17:55:35 Timer event: 0ms: Update visualizer, xref, advice listeners for (separate thread): aspects
But in the class BaseCDORevision.java I can not see any advice markers, nor is "=== BANG! ===" output when I start the program.
I have no clue where to start. Please help ;-)
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: Can't see advice being applied [message #656004 is a reply to message #655997] |
Wed, 23 February 2011 17:14 |
|
When I copy the BaseCDORevision.java file into the "aspects" project I can see that the advice is properly applied.
Shouldn't the aspect be applied to source in other (plugin) projects, as well?
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Am 23.02.2011 17:59, schrieb Eike Stepper:
> Hi,
>
> I'm making my first steps with ApsectJ and AJDT. Not very successful so far ;-(
>
> In my workspace I have plugin projects with my source code and I added an "aspects" project (also a plugin). I added one aspect:
>
> package aspects;
> import org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision;
>
> public aspect Universe
> {
> before() : execution(* BaseCDORevision.*(..)) { bang(); }
>
> private static void bang() { System.err.println("=== BANG! ==="); }
> }
>
> The AJDT Event Trace view shows this:
>
> 17:55:34 ============================================================ ===============================
> 17:55:34 Build kind = AUTOBUILD
> 17:55:34 Project=aspects, kind of build requested=Incremental AspectJ compilation
> 17:55:34 Timer event: 0ms: Flush included source file cache
> 17:55:34 Timer event: 0ms: Check delta
> 17:55:34 File: C:\develop\ws\aspectj\aspects\src\aspects\Universe.aj has changed.
> 17:55:34 build: Examined delta - 1 changed, 0 added, and 0 deleted source files in required project aspects
> 17:55:34 Timer event: 1ms: Looking for and marking configuration changes in aspects
> 17:55:34 Configuration changes found: true
> 17:55:34 Timer event: 1ms: Look for source/resource changes
> 17:55:34 Setting list of classpath elements with modified contents:
> 17:55:34 [C:/develop/ws/aspectj/plugins/org.eclipse.net4j.tcp/bin, C:/develop/ws/aspectj/plugins/org.eclipse.net4j.util/bin, C:/develop/ws/aspectj/plugins/org.eclipse.net4j/bin, C:/develop/ws/aspectj/plugins/org.eclipse.emf.cdo.server/bin , C:/develop/ws/aspectj/plugins/org.eclipse.emf.cdo.common/bin , C:/develop/ws/aspectj/plugins/org.eclipse.emf.cdo.server.net 4j/bin]
> 17:55:34 Timer event: 46ms: Pre compile
> 17:55:34 Sending the following configuration changes to the compiler: []
> 17:55:34 1 source file changes since last build
> 17:55:34 Compiler configuration for project aspects has been read by compiler. Resetting.
> 17:55:34 Configuration was []
> 17:55:34 Resetting list of modified source files. Was [C:\develop\ws\aspectj\aspects\src\aspects\Universe.aj]
> 17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.net4j.tcp\bin
> 17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.net4j.tcp\bin' is apparently unchanged so not performing timestamp check
> 17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.net4j.util\bin
> 17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.net4j.util\bin' is apparently unchanged so not performing timestamp check
> 17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.net4j\bin
> 17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.net4j\bin' is apparently unchanged so not performing timestamp check
> 17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.server\bin
> 17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.server\bi n' is apparently unchanged so not performing timestamp check
> 17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.common\bin
> 17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.common\bi n' is apparently unchanged so not performing timestamp check
> 17:55:34 ClassFileChangeChecking: failed to find a state instance managing output location : C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.server.net 4j\bin
> 17:55:34 ClassFileChangeChecking: queried JDT and 'C:\develop\ws\aspectj\plugins\org.eclipse.emf.cdo.server.ne t4j\bin' is apparently unchanged so not performing timestamp check
> 17:55:34 Preparing for build: planning to be an incremental build
> 17:55:34 Starting incremental compilation loop 1 of possibly 5
> 17:55:34 Timer event: 303ms: Time to first compiled message
> 17:55:34 Dropping back to full build
> 17:55:34 Preparing for build: not going to be incremental because no successful previous full build
> 17:55:35 Timer event: 735ms: Time to first woven message
> 17:55:35 AspectJ reports build successful, build was: FULL
> 17:55:35 AJDE Callback: finish. Was full build: true
> 17:55:35 Timer event: 1588ms: Total time spent in AJDE
> 17:55:35 Timer event: 0ms: Refresh after build
> 17:55:35 Types affected during build = 1133
> 17:55:35 Timer event: 1638ms: Total time spent in AJBuilder.build()
> 17:55:35 Timer event: 5ms: Delete markers: aspects (Finished deleting markers for aspects)
> 17:55:35 Timer event: 0ms: Create markers: aspects (Finished creating markers for aspects)
> 17:55:35 Created 0 markers in 1 files
> 17:55:35 Timer event: 0ms: Update visualizer, xref, advice listeners for (separate thread): aspects
>
>
> But in the class BaseCDORevision.java I can not see any advice markers, nor is "=== BANG! ===" output when I start the program.
>
> I have no clue where to start. Please help ;-)
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03666 seconds