JMangler (version 3 and higher) is more than just a load-time transformation framework. It has an open architecture, which lets existing class file transformation frameworks transparently take advantage of its generic interception mechanism. Thus it is a generic enabler for the load-time use of existing frameworks. Figure 15-2 illustrates the essential parts of the architecture.
Hook. The "hook" implements the generic interception mechanism and extends Java's linear class loading scheme by nested class loading (see Section 15.4). It manages intercepted class files as byte streams.
Weavers. Weavers provide the real weaving functionality. Because generic interception is already performed by the hook, weavers can be implemented on top of all existing class file transformation frameworks [4, 8, 9, 11, 12, 34, 35], including those that were not designed for load-time use. Weavers are not constrained in any way. In the simplest case, a weaver consists of a few classes that implement the weaver interface on the basis of a particular transformation framework. However, weavers can provide arbitrary additional functionality beyond the one supported by the underlying framework. For instance, the JMangler distribution includes a weaver based on BCEL [4, 11, 12]. In addition to the functionality of BCEL, it provides specific support for controlling the weaving process to enable composition of independently developed transformer components (see Section 15.5). Other researchers have already expressed their interest in implementing weavers for ASM [8] and Javassist [9].
Weaver interface. The weaver interface is a collection of Java interfaces that establish the connection between the hook and the weavers. They mediate the passing of class file representations from the hook to the weavers and back again.