Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] For tracing many ltw concrete-aspects or single one with lookup table

I am trying to develop a development framework where we can introduce a delay at arbitrary but simple join-points. This is intended for some testing related to concurrency and such-like.

What I want to be able to do is, on different runs specify a method before or after execution of which the thread should pause. For any run, I don't expect the total pauses to be more then 10, if that many.

I can think of two ways to do this and would appreciate very much any views on their pros and cons.

One approach is to define two abstract aspects, PauseBefore and PauseAfter. In aop.xml concrete aspects are defined that extend one of the two. The other approach is to have single Pause aspect that reads an external file that lists the method names and before/after labels.

The biggest problem with the abstract aspect approach is writing the aop.xml. The runs will likely be done by others with no experience with AspectJ or even programming, and I will need to build some kind of tool that creates the aop.xml file and packages it correctly in a jar.

With a single aspect I guess every method will have to be instrumented , which will that be too much of an overhead? If that can be compensated somehow, I can think of many advantages, such as changing the configuration on the fly without restarting the process, specifying the wait time.

There must be middle-road that is the best approach, but I am not able to see it. Any advice?

Back to the top