Tag Archives: weaving

weaving: spring and eclipselink

What is weaving?

Weaving: linking aspects with other application types or objects to create an advised object. This can be done at compile time (using the AspectJ compiler, for example), load time, or at runtime. Spring AOP, like other pure Java AOP frameworks, performs weaving at runtime. (http://static.springsource.org/spring/docs/2.5.x/reference/aop.html)

So weaving is used to load objects and manipulate them… so… why? and why did this concern me?

ok in my project we use spring with eclipselink and the idea was to create the entities in spring and just @Autowire them for usage…  but it needed a InstumentalLoadTimeWeaver to do so… and this Weaver needs to run in a special java-agent (spring-agent)… which is really crap on a server… so it really concerned me!

Solution? EclipseLink allows the configuration weaving=false (link)… which just simply disables the dynamic weaving, so no weaver is used and no java-agent is used… hurray…

but… what are the side-effects?

… to weave all applicable class files at build time so that you can deliver pre-woven class files. Consider this option to weave all applicable class files at build time so that you can deliver prewoven class files. By doing so, you can improve application performance by eliminating the runtime weaving step required by dynamic weaving… (http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Weaving)

so its this a solution? i think so 🙂