Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Why need AspectJ all libraries of my .jar I want to instrument

Michael,

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.

Ron

Ron Bodkin
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
> 
> Hi,
> 
> 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?
> 
> Thanks,
> Michael Dempfle
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> 


Back to the top