[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
|
- From: Choudary Kothapalli <choudary.kothapalli@xxxxxxxxx>
- Date: Fri, 31 Jul 2009 00:25:50 -0400
- Delivered-to: aspectj-dev@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=cMdYdPYYlsZQAoYHc9iAlT5HH+D2Y8lVcxLcefsFBsA=; b=R6k2kDVIIx1Uz8kkTx7sufhKC+XLQ4wa8m6LFC18QVglcZkdZZH9tnErYgjdjhVowP eZGsBwziLsuGdUvNkFIexQ7ORRpECJ7TDWNlwMAvFIaxR9lk8VLb5bZP5eouFXviNWVQ FKXeXzJOQWZAy8liBzEqejSefBVmqblZCdnFM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=To/VS5GQXRQdDez1k7X1hBOgi8brxpXzIkcYmWEkvxGeEchpMxSSJX/wV36/YHH+2T YE0OkgYLtyGF7VEmVInIT4qq7pl4tMxOrsHArH9xSa/NF0pGI8gkrR8letzTAtg7NwaS JfGhtdPVykfdo/tzY2fTkZ2YluDiNBju0KMuA=
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.