skip to main content
10.1145/1621607.1621621acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
research-article

Advanced runtime adaptation for Java

Published:04 October 2009Publication History

ABSTRACT

Dynamic aspect-oriented programming (AOP) enables runtime adaptation of aspects, which is important for building sophisticated, aspect-based software engineering tools, such as adaptive profilers or debuggers that dynamically modify instrumentation code in response to user interactions. Today, many AOP frameworks for Java, notably AspectJ, focus on aspect weaving at compile-time or at load-time, and offer only limited support for aspect adaptation and reweaving at runtime. In this paper, we introduce 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 a novel mechanism for inter-advice communication, enabling efficient data passing between advices that are woven into the same method. We explain HotWave's programming model and discuss our implementation techniques. As case study, we present an adaptive, aspect-based profiler that leverages HotWave's distinguishing features.

References

  1. B. Alpern, C. R. Attanasio, J. J. Barton, B. Burke, P. Cheng, J.-D. Choi, A. Cocchi, S. J. Fink, D. Grove, M. Hind, S. F. Hummel, D. Lieber, V. Litvinov, M. F. Mergen, N. Ngo, J. R. Russell, V. Sarkar, M. J. Serrano, J. C. Shepherd, S. E. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeno virtual machine. IBM Systems Journal, 39(1):211--238, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. G. Ammons, T. Ball, and J. R. Larus. Exploiting hardware performance counters with flow and context sensitive profiling. In PLDI'97: Proceedings of the ACM SIGPLAN 1997 conference on Programming language design and implementation, pages 85--96. ACM Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. P. Avgustinov, A. S. Christensen, L. J. Hendren, S. Kuzins, J. Lhotak, O. Lhotak, O. deMoor, D. Sereni, G. Sittampalam, and J. Tibble. abc: An extensible AspectJ compiler. In AOSD'05: Proceedings of the 4th International Conference on Aspect-Oriented Software Development, pages 87--98, New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. L. D. Benavides, R. Douence, and M. Sudholt. Debugging and testing middleware with aspect-based control-flow and causal patterns. In Middleware'08: Proceedings of the 9th ACM/IFIP/USENIX International Conference on Middleware, pages 183--202, New York, NY, USA, 2008. Springer-Verlag New York, Inc. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Bergel. FacetS: First class entities for an open dynamic AOP language. In Proceedings of the Open and Dynamic Aspect Languages Workshop, Mar. 2006.Google ScholarGoogle Scholar
  6. W. Binder and J. Hulaas. Flexible and efficient measurement of dynamic bytecode metrics. In Fifth International Conference on Generative Programming and Component Engineering (GPCE-2006), pages 171--180, Portland, Oregon, USA, Oct. 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. W. Binder, J. Hulaas, and P. Moret. Advanced Java Bytecode Instrumentation. In PPPJ'07: Proceedings of the 5th International Symposium on Principles and Practice of Programming in Java, pages 135--144, New York, NY, USA, 2007. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. W. Binder, J. Hulaas, P.Moret, and A. Villazon. Platform-independent profiling in a virtual execution environment. Software: Practice and Experience, 39(1):47--79, 2009. http://dx.doi.org/10.1002/spe.890. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. C. Bockisch, M. Haupt, M. Mezini, and K. Ostermann. Virtual machine support for dynamic join points. In AOSD, pages 83--92, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Chiba, Y. Sato, and M. Tatsubori. Using Hotswap for Implementing Dynamic AOP Systems. In 1st Workshop on Advancing the State-of-the-Art in Run-time Inspection, 2003.Google ScholarGoogle Scholar
  11. M. Dmitriev. Profiling Java applications using code hotswapping and dynamic call graph revelation. In WOSP'04: Proceedings of the Fourth International Workshop on Software and Performance, pages 139--150. ACM Press, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Gosling, B. Joy, G. L. Steele, and G. Bracha. The Java Language Specification, Third Edition. The Java Series. Addison-Wesley, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E. Hilsdale and J. Hugunin. Advice weaving in AspectJ. In AOSD'04: Proceedings of the 3rd International Conference on Aspect-Oriented Software Development, pages 26--35, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. R. Hirschfeld. AspectS - Aspect-Oriented Programming with Squeak. In NODe'02: Revised Papers from the International Conference NetObjectDays on Objects, Components, Architectures, Services, and Applications for a Networked World, pages 216--232, London, UK, 2003. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. JBoss. Javassist Project. Web pages at http://jboss.com/javassist/.Google ScholarGoogle Scholar
  16. JBoss. Open source middleware software. Web pages at http://labs.jboss.com/jbossaop/.Google ScholarGoogle Scholar
  17. G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In J. L. Knudsen, editor, Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP-2001), volume 2072 of Lecture Notes in Computer Science, pages 327--353, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. G. Kiczales, J. Lamping, A. Menhdhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-Oriented Programming. In M. Aksit and S. Matsuoka, editors, Proceedings of European Conference on Object-Oriented Programming, volume 1241, pages 220--242. Springer-Verlag, Berlin, Heidelberg, and New York, 1997.Google ScholarGoogle Scholar
  19. J. Manson, W. Pugh, and S. V. Adve. The Java Memory Model. In POPL'05: Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 378--391, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. H. Masuhara, G. Kiczales, and C. Dutchyn. A compilation and optimization model for aspect-oriented programs. In Compiler Construction, volume 2622 of Springer Lecture Notes in Computer Science, pages 46--60. Springer, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. P. Moret, W. Binder, and A. Villazon. CCCP: Complete calling context profiling in virtual execution environments. In PEPM'09: Proceedings of the 2009 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, pages 151--160, Savannah, GA, USA, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. NetBeans. The NetBeans Profiler Project. Web pages at http://profiler.netbeans.org/.Google ScholarGoogle Scholar
  23. A. Nicoara and G. Alonso. Making applications persistent at runtime. International Conference on Data Engineering, 15:1368--1372, 2007.Google ScholarGoogle ScholarCross RefCross Ref
  24. A. Nicoara, G. Alonso, and T. Roscoe. Controlled, Systematic, and Efficient Code Replacement for Running Java Programs. In Eurosys'08: Proceedings of the 3rd ACMSIGOPS/EuroSys European Conference on Computer Systems 2008, pages 233--246, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. OSGi Alliance. OSGi Alliance Specifications. Web pages at http://www.osgi.org/Specifications/.Google ScholarGoogle Scholar
  26. R. Pawlak, L. Seinturier, L. Duchien, G. Florin, F. Legond-Aubry, and L. Martelli. JAC: An Aspect-based Distributed Dynamic Framework. Softw. Pract. Exper., 34(12):1119--1148, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. D. J. Pearce, M. Webster, R. Berry, and P. H. J. Kelly. Profiling with AspectJ. Software: Practice and Experience, 37(7):747--777, June 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. A. Popovici, G. Alonso, and T. Gross. Just-in-time aspects: efficient dynamic weaving for Java. In AOSD'03: Proceedings of the 2nd International Conference on Aspect-Oriented Software Development, pages 100--109, New York, NY, USA, 2003. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. A. Popovici, T. Gross, and G. Alonso. Dynamic weaving for aspect-oriented programming. In AOSD'02: Proceedings of the 1st international conference on Aspect-oriented software development, pages 141--147, New York, NY, USA, 2002. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. SunMicrosystems, Inc. Java Platform Debugger Architecture (JDPA). Web pages at http://java.sun.com/javase/technologies/core/toolsapis/jpda/.Google ScholarGoogle Scholar
  31. Sun Microsystems, Inc. JVM Tool Interface (JVMTI) version 1.1. Web pages at http://java.sun.com/javase/6/docs/platform/jvmti/jvmti.html.Google ScholarGoogle Scholar
  32. W. Vanderperren, D. Suvee, B. Verheecke, M. A. Cibran, and V. Jonckers. Adaptive Programming in JAsCo. In AOSD'05: Proceedings of the 4th international conference on Aspect-oriented software development, pages 75--86, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. A. Vasseur. Dynamic AOP and RuntimeWeaving for Java - How does AspectWerkz address it? In Dynamic Aspects Workshop (DAW04), Lancaster, England, Mar. 2004.Google ScholarGoogle Scholar
  34. A. Villazon, W. Binder, and P. Moret. Aspect Weaving in Standard Java Class Libraries. In PPPJ'08: Proceedings of the 6th International Symposium on Principles and Practice of Programming in Java, pages 159--167, New York, NY, USA, Sept. 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. A. Villazon, W. Binder, and P. Moret. Flexible Calling Context Reification for Aspect-Oriented Programming. In AOSD'09: Proceedings of the 8th International Conference on Aspect-oriented Software Development, pages 63--74, Charlottesville, Virginia, USA, Mar. 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. X. Zhuang, M. J. Serrano, H. W. Cain, and J.-D. Choi. Accurate, efficient, and adaptive calling context profiling. In PLDI'06: Proceedings of the 2006 ACMSIGPLAN conference on Programming language design and implementation, pages 263--271, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Advanced runtime adaptation for Java

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!