A join point for loops in AspectJ

  • Authors:
  • Bruno Harbulot;John R. Gurd

  • Affiliations:
  • The University of Manchester, Manchester, UK;The University of Manchester, Manchester, UK

  • Venue:
  • Proceedings of the 5th international conference on Aspect-oriented software development
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

The current AspectJ join points represent locations in the code that are the interface of the Java objects. However, not all the "things that happen" happen at the interfaces. In particular, loops are a key place that could be advised for parallelisation. This article presents a loop join point model, which allows AspectJ to intervene directly in loops. More generally, this demonstrates the need for, and provides, a more complex join point in AspectJ.The approach used for recognising loops is based on a control-flow analysis at the bytecode level; this avoids ambiguities due to alternative forms of source-code that would effectively produce identical loops. This model is also enhanced with a mechanism for context exposure, which is pivotal for giving a meaning to the use of this join point, and with additional information through join point reflection. The context exposure is particularly useful for writing pointcuts that select specific loops only, and the problem of loop selection is also presented in the paper.Finally, LoopsAJ, an extension for the abc compiler that provides AspectJ with a loop join point, is presented. It is shown how to use this extension for writing aspects that parallelise loops.