Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Newbie question : weaving Action.actionPerformed() method

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

[quote Gaetan Zoritchak::on 2/5/2005 11:35 PM]
| Hi all,
|
| I want to put an advise on all the call to the
| Action.actionPerformed() method in order to improve the coding policy
| of my application.
|
| I used the following code :
|
| public aspect CheckActionIdPolicy {
|
|     before ()
|     	: call(public void Action+.actionPerformed(*)){
|         System.out.println("Calling actionPerformed on :"
|              + thisJoinPoint.getTarget());
|     }
| }
|
|
| The problem is that I only intercept method calls from my code to
| actionPerformed().
|
| How can I intercept the calls from the javax.swing package to my
| actionPerformed methods?
|
| Thanks,
|
| ======================
| Gaetan Zoritchak
| ======================


Hi!

- - in case you want to advice your implementations of Action interface you should improve the
pointcut definition (probably using some within-s)

- - in case you want to advice call-s, you will be required to weave (expose to the weaver) all 3rd
parties jars (including rt.jar - and this may break SUN licensing)

- - in case you want to weave (expose to the weaver) only your code you should advice execution-s

hth

- --
:alex |.::the_mindstorm::.|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFCBUE7TTDTje0R2dgRAj6ZAJ9wd6K4D0NL5qKarAS6aPtrPJKjvACfcTnZ
7ZSDHMvjJiCP6ZLpNUb1N+8=
=+7f/
-----END PGP SIGNATURE-----


Back to the top