Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] if and loop pointcuts

Diana:

>  No, I want to have an aspect that takes a lock at the first access to a
> variable (this is easy to detect) and releases the lock after the last access
> to that variable (and here comes my problem).

Why not refactor your primary code so that only the code that accesses the 
attribute is in a method all by itself, then use before and after advice on 
that method to get and release the lock?

It would seem to me that your code is not very well structured...and that 
some refactoring would go a long way to solving your problem.

Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com



Back to the top