[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-users] Why need AspectJ all libraries of my .jar I want to instrument
- From: "Ron Bodkin" <rbodkin@xxxxxxxxxxxxxx>
- Date: Wed, 25 Feb 2004 09:58:30 -0500
- Delivered-to: firstname.lastname@example.org
- Organization: New Aspects of Security
I have done something similar with the TopLink jar. What I did was to explode the jar and to incrementally strip down to a subset of classes that referenced the jars I did have. The other classes are never loaded by my app so by definition I don't need them. I did this by removing any class files that had references the weaver choked on, then retrying to weave again, and repeating until there were no errors. This is a recipe that should work for weaving into any jar that has references to classes you don't have access to.
This is a case where having weaving classloader support will be very helpful: you will never need to worry about having unreferenced classes in the classes you load (since this would also cause the JVM to throw a class not found exception).
Note that in many cases the weaver does need to resolve references to external types, so it would be fairly complicated to optimize it to minimize such dependencies. I think classloader weaving is the way to go.
Chief Technology Officer
New Aspects of Software
m: (415) 509-2895
> ------------Original Message------------
> From: Michael Dempfle <mdempfle@xxxxxxxxxx>
> To: aspectj-users@xxxxxxxxxxx
> Date: Wed, Feb-25-2004 6:50 AM
> Subject: [aspectj-users] Why need AspectJ all libraries of my .jar I want to instrument
> I want to insert aspects in a .jar file of oc4j.
> Unfortunately this jar file is not very consistent and has classes
> which ware not used but uses classes which are not available.
> When I want to use AspectJ I cannot weave the code
> into the other class files because AspectJ is checking everything.
> Is it possilbe to remove this check? AspectJ is using BCEL and
> therefore there is not need for that!.
> Are there any solutions?
> Michael Dempfle
> aspectj-users mailing list