Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] prebuilding "jump tables" - question/suggestion...

Guys,

Firstly, I'd like to play the newbie disclaimer card :-) If this is a stupid posting, please forgive...

Secondly, I'd like to thank the AspectJ team/community for a great project. It is making my life immeasurably easier.

Thirdly - to business...

I'm using AspectJ on a project that I am writing (wadi.codehaus.org).

There are several places where I wrap a notification aspect around a number of setters on various classes. When the setter is called interested parties are notified of the event.

The name of the method called and information that I put into the event that I raise may be transformed into one another e.g. setX -> X etc...

This transformation involves allocation which is not something that I want to do every time a setter is called.

So I am currently pre-building a static jumptable through which I indirect at call time so that I only have to do this allocation once, offline.

Here is the code:

http://cvs.wadi.codehaus.org/wadi/src/java/org/codehaus/wadi/tomcat/PropertyNotification.aj?only_with_tag=HEAD&view=markup

however I find myself having to enter by hand much of the information that I would expect to be able to pull out of the aspect somehow.

I figure that ultimately, to avoid divergence between this particular aspect and its client class[es], I would rather bind the two using something like xdoclet (c.f. Barter: http://barter.sourceforge.net/#examples).

So:

question:

are other people going through the same pain?

is there no introspective object available in my static{} block, which represents everything know at compile time about the aspect and which I can use to introspect upon it and retrieve the full list of pointcuts with which it is associated ?

why, in an org.aspectj.lang.Signature is there no reference to the corresponding java.lang.reflect.Method object ?

If the above is the case, do people think that these would be useful additions, or have I grasped the wrong end of the stick ?


Thanks for your time,


Jules

--
/*************************************
* Jules Gosnell
* Partner
* Core Developers Network (Europe)
* http://www.coredevelopers.net
*************************************/




Back to the top