Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] Can I intercept before a class is load time weaved

This question follows the thread on InvalidClassException while
deserializing classes without SUID. The link to that thread is
http://dev.eclipse.org/mhonarc/lists/aspectj-dev/msg02496.html .

I could not get rid of the exception and my only solution is to
exclude all those Serializable classes without SUID. I ask my users to
exclude those classes in aop.xml, but in a large legacy application,
it is a tedious process. I need to find a simpler solution.

A probable solution is to intercept just before weaving a class, check
if that class is Serializable without SUID and if so, not to weave it.
This would need two things:

1. Ability to intercept just before a class is load time weaved. In
this 'advice', the normal class should be available so that a check
can be made for SUID using java reflection.
2. Ability to proceed without weaving if I don't want to weave that class.

I don't find a way to do this currently. By the time
'staticinitialization' is intercepted, the class may be weaved
already.

Again, I don't think this is any problem with AspectJ. It is just
something I need and I am checking if you could offer any solution
with your knowledge of AspectJ implementation.

Thanks,
Choudary Kothapalli.


Back to the top