Using HotSwap for Implementing Dynamic AOP Systems

Practical demands on dynamic aspect-oriented programming (AOP) are getting well recognized. For example, logging functionality is a typical application of AOP but the usefulness of this functionality is limited without dynamic AOP. When we are debugging a program, we tend to want dynamically adding or removing various logging aspects without restarting the program. Suppose that the program is a Web application server and there is a bug that appears only after long product run. If the program is restarted for logging, all the internal data structures are reset and hence the context causing the bug would be lost. Another crosscutting concern that should be dynamically woven is security fixes. Suppose that your organization is running a web application server for selling your products. Since such a web server cannot stop except scheduled maintenance time, if it turns out that the server has a security problem, a patch fixing the problem should be applied to the server without shutting it down. If a better patch is released later, the previous patch should be removed and instead the new one should be applied. The patch will be used until the server is rebooted after the bug is fixed in a clean way at scheduled maintenance time. Developing an implementation technique for dynamic AOP systems is still a research topic especially in Java. Since one of the most important features of Java is platform independence, dynamic AOP systems are required to be built on top of the standard Java virtual machine (JVM). A modified JVM for dynamic AOP is not acceptable in practice. This paper presents our Java-based dynamic AOP system called Wool .F or better performance than other systems, Wool is implemented with our novel technique exploiting the HotSwap mechanism recently introduced by the Java2 SDK 1.4. This mechanism allows us to dynamically reload a class file to update the class definition. However, naively using this mechanism does not improve execution performance. This paper mentions how this mechanism should be used with others to really improve performance.