Dynamic aspect-oriented programming in java: the hotwave experience

  • Authors:
  • Danilo Ansaloni;Walter Binder;Philippe Moret;Alex Villazón

  • Affiliations:
  • Faculty of Informatics, University of Lugano, Switzerland;Faculty of Informatics, University of Lugano, Switzerland;Faculty of Informatics, University of Lugano, Switzerland;Faculty of Informatics, University of Lugano, Switzerland

  • Venue:
  • Transactions on Aspect-Oriented Software Development IX
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Dynamic aspect-oriented programming (AOP) enables runtime adaptation of programs. It enables sophisticated, aspect-based software engineering tools, such as adaptive profilers or debuggers, which dynamically modify instrumentation code in response to user interactions. Today, many AOP frameworks for Java, notably AspectJ, focus on aspect weaving at build-time or at load-time, and offer only limited support for program adaptation by (re)weaving aspects at runtime. In this article, we present HotWave, an AOP framework based on AspectJ for standard Java Virtual Machines (JVMs). HotWave supports dynamic (re)weaving of previously loaded classes, and it ensures that all classes loaded in a JVM can be (re)woven, including the classes of the standard Java class library. HotWave features inter-advice communication, a mechanism that allows for efficient data passing between advice that are woven into the same method. We explain HotWave's programming model and discuss our implementation techniques. As a case study, we present an adaptive, aspect-based profiler that leverages HotWave's distinguishing features. A performance evaluation shows that HotWave does not introduce any overhead when no aspect is woven and explores the overhead of runtime weaving. While the duration of runtime weaving can be significant, the execution of woven code with HotWave does not incur any extra overhead when compared to the execution of code woven at build-time or at load-time.