arrow
Return

Efficient runtime aspect weaving for Java applications

delete2018-08-01
delete1
delete
OA
AI
O
Oscar Rodriguez-Prieto
F
Francisco Ortín *
D
Donna O’Shea
DOI:10.1016/j.infsof.2018.03.012delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
Context: The aspect-oriented paradigm is aimed at solving the code scattering and tangling problem, providing new mechanisms to support better separation of concerns. For specific scenarios where high runtime adaptability is an important requirement, dynamic Aspect-Oriented Programming (AOP) represents a useful tool. With dynamic AOP, components and aspects can be woven and unwoven at runtime, enabling applications greater responsiveness when dealing with different or changing requirements. However, this responsiveness typically incurs a cost in terms of runtime performance and memory consumption. Objective: Build an efficient dynamic aspect weaver for Java that provides the best runtime performance compared to the existing approaches, minimum memory overhead consumption, and similar functionalities to the widespread runtime weavers. Method: We design and implement weaveJ, a dynamic aspect weaver for Java. This dynamic weaver leverages the invokedynamic opcode introduced in Java 7, which allows dynamic relinkage of method and field access. We compare the functionalities of weaveJ with the existing dynamic weavers for Java, and evaluate their runtime performance and memory consumption. Results: weaveJ shows the best runtime performance for all benchmarks and real applications executed. Method interception with invokedynamic is at least 142% faster than the techniques used by the existing runtime weavers. The average cost of dynamic weaving using invokedynamic is only 2.2% for short running programs, and 1.5% for long running applications. Moreover, the use of aspects in weaveJ does not imply additional memory consumption. Conclusion: The dynamic aspect weaver implemented demonstrates that invokedynamic is a suitable mechanism to provide efficient runtime aspect weaving for Java applications. Moreover, it supports concurrent and programmatic aspect (un)weaving at any point of execution, a wide set of join points, class and object weaving, and allow aspects to have their own state. Neither the Java language nor the virtual machine needs to be modified.
Keywords:
Runtime adaptation
Aspect weaving
invokedynamic
Aspect-oriented programming
Java
Runtime performance
Runtime monitoring for next generation Java ME platform
err2010-02-01
err9
errOAAI
errCosta, Gabriele; Martinelli, Fabio; Mori, Paolo; Schaefer, Christian; Walter, Thomas
errShare
errSave
errShare
errSave
Aspectizing Java Access Control
err2012-01-01
err6
PREAI
errToledo, Rodolfo; Nunez, Angel; Tanter, Eric; Noye, Jacques
errShare
errSave
Efficient runtime metaprogramming services for Java
err2019-07-01
err4
errOAAI
errLagartos, Ignacio; Manuel Redondo, Jose; Ortin, Francisco
errShare
errSave
errShare
errSave
Automated Detection of Software Performance Antipatterns in Java-Based Applications
err2023-04-01
err5
errOAAI
errTrubiani, Catia; Pinciroli, Riccardo; Biaggi, Andrea; Fontana, Francesca Arcelli
errShare
errSave

Journal

Information and Software Technology cover
Information and Software Technology
IF:
4.3
Papers:
3.8K
Citations:
9.5K

Organization

M
munster technological university (mtu)
Scholars:
732
Papers: 668
Citations: 1.2K
U
University of Oviedo
Scholars:
250
Papers: 104
Citations: 4.8K
Cited Papers

Cited Papers

The Runtime Performance of invokedynamic: An Evaluation with a Java Library
err2014-07-01
err17
PREAI
errOrtin, Francisco; Conde, Patricia; Fernandez-Lanvin, Daniel; Izquierdo, Raul
errShare
errSave
Wake up and smell the coffee: Evaluation methodology for the 21st century
err2008-08-01
err68
errOAAI
errBlackburn, Stephen M.; McKinley, Kathryn S.; Garner, Robin; Hoffmann, Chris; Khan, Asjad M.; Bentzur, Rotem; Diwan, Amer; Feinberg, Daniel; Frampton, Daniel; Guyer, Samuel Z.; Hirzel, Martin; Hosking, Antony; Jump, Maria; Lee, Han; Eliot, J.; Moss, B.; Phansalkar, Aashish; Stefanovic, Darko; VanDrunen, Thomas; von Dincklage, Daniel; Wiedermann, Ben
errShare
errSave
errShare
errSave
Expert in conflicts
err2009-04-01
err2
PREAI
errCasas, Sandra I.; Garcia Perez-Schofield, J. Baltasar; Marcos, Claudia A.
errShare
errSave
no more