Skip to main content

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

Greetings.

Is it possible, and if yes then how, to apply aspects programmatically
using only AspectJ? I know Spring AOP allows this, but I can't figure
out how to do this in the code.

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?

Thanks.

Oleg


Back to the top