Skip to main content

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

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



Back to the top