Aspect weaving in standard Java class libraries

Aspect-oriented programming (AOP) has been successfully applied to application code thanks to techniques such as Java bytecode instrumentation. Unfortunately, with current technology, such as AspectJ, aspects cannot be woven into standard Java class libraries. This restriction is particularly unfortunate for aspects that would benefit from a complete bytecode coverage, such as profiling or debugging aspects. In this paper we present an adaptation of the popular AspectJ weaver that is able to weave aspects also into standard Java class libraries. We evaluate our approach with existing profiling aspects, which now cover all bytecode executing in the virtual machine. In addition, we present a new aspect for memory leak detection that also benefits from our approach.

[1]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[2]  Walter Binder,et al.  Advanced Java bytecode instrumentation , 2007, PPPJ.

[3]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.

[4]  Assaf Schuster,et al.  Instrumentation of standard libraries in object-oriented languages: the twin class hierarchy approach , 2004, OOPSLA '04.

[5]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.

[6]  Paul H. J. Kelly,et al.  Profiling with AspectJ , 2007 .

[7]  Nick Mitchell,et al.  LeakBot: An Automated and Lightweight Tool for Diagnosing Memory Leaks in Large Java Applications , 2003, ECOOP.

[8]  Kung Chen,et al.  Aspect-Based Instrumentation for Locating Memory Leaks in Java Programs , 2007, 31st Annual International Computer Software and Applications Conference (COMPSAC 2007).

[9]  Yannis Smaragdakis,et al.  Transparent program transformations in the presence of opaque code , 2006, GPCE '06.

[10]  Gustavo Alonso,et al.  Just-in-time aspects: efficient dynamic weaving for Java , 2003, AOSD '03.

[11]  David Gregg,et al.  A method‐level comparison of the Java Grande and SPEC JVM98 benchmark suites , 2005, Concurr. Pract. Exp..

[12]  Jim Hugunin,et al.  Advice weaving in AspectJ , 2004, AOSD '04.

[13]  Shigeru Chiba,et al.  Load-Time Structural Reflection in Java , 2000, ECOOP.

[14]  Oege de Moor,et al.  Measuring the dynamic behaviour of AspectJ programs , 2004, OOPSLA.

[15]  Ondrej Lhoták,et al.  abc: an extensible AspectJ compiler , 2005, AOSD '05.

[16]  Laurie J. Hendren,et al.  Optimizing Java Bytecode Using the Soot Framework: Is It Feasible? , 2000, CC.

[17]  Walter Binder,et al.  A Portable and Customizable Profiling Framework for Java Based on Bytecode Instruction Counting , 2005, APLAS.

[18]  Kathryn S. McKinley,et al.  Cork: dynamic memory leak detection for garbage-collected languages , 2007, POPL '07.

[19]  Jozo J. Dujmovic,et al.  Visualization of Java workloads using ternary diagrams , 2004, WOSP '04.

[20]  Markus Dahm,et al.  Byte Code Engineering , 1999, Java-Informations-Tage.

[21]  Sheng Liang,et al.  Java Virtual Machine Profiler Interface , 2000, IBM Syst. J..

[22]  Laurie J. Hendren,et al.  *J: a tool for dynamic analysis of Java programs , 2003, OOPSLA '03.

[23]  Mikhail Dmitriev Profiling Java applications using code hotswapping and dynamic call graph revelation , 2004, WOSP '04.

[24]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[25]  Éric Tanter,et al.  Altering Java Semantics via Bytecode Manipulation , 2002, GPCE.

[26]  Stephen J. Fink,et al.  The Jalapeño virtual machine , 2000, IBM Syst. J..