Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ajdt-dev] adding aspects to external jars

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[quote Steve Gollery::on 1/25/2005 1:52 AM]
| I'm just starting with ajdt and ran into something I could use some help
| with. I'd like to attach aspects to classes in external jar files, but I
| can't figure out how to make it work.
|
| In the Aspect Visualization perspective, the jar I want to use is on the
| project list. I can right click on it and select new...aspect, then set
| the package in the wizard and enter a name for the aspect. Then I edit
| the aspect to add a pointcut on the execution of one of the methods of a
| class in that package of the jar file, and advice to execute when the
| method is called. This all compiles with no errors or warnings.
|
| But the advice never executes. Since this very simple advice following
| the same pattern as the "hello world" tutorial, I don't think there's
| anything wrong with the code:
|
| package com.hp.hpl.jena.ontology;
| public aspect OntologyAspect {
| 	pointcut onReadModel() : execution(* OntModel.read(..));
| 	before() : onReadModel() { System.out.println("reading the model"); }
| }
|
|
| Is it possible to write aspects that advise methods in external jar
| files? Or is there something else I need to do to set it up?
|
| Thanks in advance,
|
| Steven Gollery
| CADRC
|
| _______________________________________________
| ajdt-dev mailing list
| ajdt-dev@xxxxxxxxxxx
| http://dev.eclipse.org/mailman/listinfo/ajdt-dev
|
I guess what are you looking for is best described here:
http://www.aspectprogrammer.org/blogs/adrian/2004/10/three_paths_sta.html.

- --
:pope
[the_mindstorm]

ps: i guess that aspectj-users mailing list is more suited for this types of questions ;-).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFB9Y7tTTDTje0R2dgRAsWDAJ40CjLjejrDOe2QRzDHxNvrTiZyPQCfXSFc
4FuNxW4+bo67MVyU7pN3zKQ=
=Y9m9
-----END PGP SIGNATURE-----


Back to the top