RISE-03

JMangler -- On-the-fly Transformation of Java Class Files

Günter Kniesel, University of Osnabrück

Linköping, December 4, 2003, 13:15-16.45


JMangler is a freely available framework for load-time transformation of compiled Java programs. Since JMangler uses no source code it can be applied even to third-party libraries. Since it works at load time, it provides the guarantee that transformations will be applied to every class that will be executed at run-time, even if the class is created dynamically or loaded from some possibly remote host.

Unlike simple byte code transformation libraries JMangler provides a complete solution for hooking into the class loading process. It does so in a JVM and class loader independent way, which works also for classes that employ their own custom class loader. Therefore, it can transform any application classes and can be used in environments like application servers, which make heavy use of custom class loaders.

The tutorial will cover all the salient features of JMangler at an interediate level.

For programmers, we will provide guidance and hands-on experience in writing, composing and applying own transformer components. For Aspect-Oriented Software Development language and tool developers, we want to convey a basic understanding of how they could take advantage of JMangler's capabilities for load-time aspect weaving or for injecting hooks that enable run-time weaving. For managers, our aim is to make them understand the potential of load-time transformation of byte code. As an example we will conclude our tutorial with a short demo of CC4J, a powerful code coverage tool developed with JMangler. This is an application that is beyond the scope of all high-level AOSD languages and systems that we know of.


Lecture outline

Transformations, the JMangler approach
Interface transformers, introduction and exercise
Code transformers, introduction and exercise
More complex code transformation, exercise
Using all transformers together, exercise
Independent extensibility, and JMangler support
JMangler and AOSD, case studies
Wrap-up and final discussion
Creator: Johan Sundström / Last modified: Friday, 07-Nov-2003 08:31:52 CET