[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] aspects on org.w3c.dom classes
|
You advice to call() is working, since (I think) you control
the call site.
Inter-type declarations won't work, unless you make the
jar files containing the target classes available to the
ajc compiler (using the -injars option). You can fix the problem
by specifying the required jar files with -injars option
(however, do check licenses of the suppliers of those jar
file. They may not allow you to do so).
There may be alternative solutions depending upon your problem.
-Ramnivas
--- Michel de Groot <rmdg@xxxxxx> wrote:
> I'm trying to intercept calls on a org.w3c.dom.Document and its
> Elements.
> For this, I use the aspect fragment below.
>
> public aspect MutationInterceptor {
>
> public String org.w3c.dom.Document.configuration;
>
> pointcut intercept() : call(*
> org.w3c.dom.Element.setAttribute(..));
>
>
> pointcut create() : call(* DocumentBuilder.newDocument(..));
>
> after(): intercept() {
>
> // do something
>
> }
>
> after() returning (Document doc) : create() {
>
> // do something
>
> }
>
> }
>
> Using a small test program which uses JAXP to create a new document
> and set
> an attribute on the document's root element, I can see that:
>
> 1) Both advises are executed; they work as expected.
>
> 2) The configuration inter-type declaration does not work as
> expected. I get
> a NoSuchMethodException.
>
> I'm using AspectJ1.1.1 with Eclipse 2.1/AJDE1.1.4, Sun JRE1.4.1_01.
>
> Can anyone give me a clue to what is going wrong?
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree