Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-dev] Applying aspects programmatically

Thanks, Eric, it makes perfect sense.

-----Original Message-----
From: aspectj-dev-bounces@xxxxxxxxxxx
[mailto:aspectj-dev-bounces@xxxxxxxxxxx] On Behalf Of Eric Bodden
Sent: Saturday, May 14, 2005 2:04 AM
To: 'AspectJ developer discussions'
Subject: RE: [aspectj-dev] Applying aspects programmatically


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

Oleg Lebedev wrote:
> Here is an example. I have a class, which uses java.util.Random. In 
> order to test this class I want to replace all Random objects with my 
> Randomizer objects. I have an aroun() advice, which does just that. 
> However, I want to be able to apply this advice and runtime when
> testing the class instead of the compile time.   
> 
> How can I do this?

Hi, Oleg.


The only approach I am aware of, which can currently actually add
pointcuts and advice during runtime is the Steamloom virtual machine. I
am pretty sure, one *has* to have VM support for this. All other
approaches, also AspectWerkz (at least the last version I have seen),
need to prepare classes (they weave hooks into the code) in order to
apply aspects at runtime.

You might want to have a look at "Phili Mayer, A Classification of
Dynamic AO Systems" [1].

Cheers,
Eric

[1]
http://aop.pmayer.net/images/3/39/A_Classification_of_Dynamic_AO_Syste
ms_Final_30.01.2005_.pdf

- -- 
Eric Bodden
Chair I2 for Programming Languages and Program Analysis
RWTH Aachen University

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3

iQA/AwUBQoWw/8wiFCm7RlWCEQKShgCeNntO0lB40pVGvQejirQb23wd3mAAniTp
JByNkoUApKISS8GtU1d3GyXA
=Zl8m
-----END PGP SIGNATURE-----


_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
If you have questions about this email, please
contact the IT Help Desk.

Mail



Back to the top