Abstract
Current implementations of reflective Java typically either require access to source code, or require a modified Java platform. This makes them unsuitable for applying reflection to Commercial-off-the-Shelf (COTS) systems. The high level nature of Java bytecode makes on-the-fly rewritings of class files feasible and this has been exploited by a number of authors. However, in practice working at bytecode level is error prone and leads to fragile code. We propose using metaobject protocols in order to specify behavioural changes and use standard bytecode rewritings to implement the changes. We have developed a reflective Java called Kava that provides behavioural runtime reflection through the use of bytecode rewriting of Java classes. In this paper we discuss the binary rewriting approach, provide an overview of the Kava system and provide an example of an application of Kava.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Massimo Ancona, Walter Cazzola, and Eduardo B. Fernandez. Reflective Authorization Systems: Possibilities, Benefits and Drawbacks. In Jan Vitek and Christian Jensen, editors, Secure Internet Programming: Security Issues for Mobile and Distributed Objects, Lecture Notes in Computer Science 1603, pages 35–51. Springer-Verlag, July 1999.
Messaoud Benantar, Bob Blakley and Anthony J. Nadalin. Approach to Object Security in Distributed SOM. IBM Systems Journal, 35(2):204–226, 1996.
Ole Agesen, Stephen N. Freund and John C. Mitchell. Adding Type Parameterization. In Proceedings of OOPSLA’97. Atlanta, Georgia. 1997.
Shigeru Chiba. Load-time Structural Reflection in Java. In Proceedings of ECOOP’2000. June 2000.
Geoff A. Cohen and Jeff Chase. Automatic Program Transformation with JOIE. In Proceedings of USENIX Annual Technical Symposium. 1998.
Grzegorz Czaijkowski and Thorsten von Eicken. JRes: A Resource Accounting Interface for Java. In Proceedings of OOPSLA’98. 1998.
Michael Gölm. Design and Implementation of a Meta Architecture for Java. Master’s thesis, University of Erlangen-Nurnberg, Germany, January 1997.
Joao Guimarães. Reflection for Statically Typed Languages. In Proceedings of ECOOP’98. July 1998.
IBM. Bean Extender Documentation, version 2.0. 1997.
Ralph Keller and Urs Holzle. Binary Component Adaptation. In Proceedings of ECOOP’98. July 1998.
Ruiz-Garcia Marc-Olivier Killijian, Jean-Charles Fabre and Shigeru Chiba. A Metaobject Protocol for Fault-Tolerant CORBA Applications. In Proceedings of the 17th Symposium on Reliable Distributed Systems (SRDS’98), pages 127–134, 1998.
Gregor Kickzales, Jim des Rivières, and Daniel G. Bobrow. The Art of the Metaobject Protocol. MIT Press, Cambridge, Massachusetts, 1991.
Sheng Liang and Gilad Bracha. Dynamic Class Loading in the Java™ Virtual Machine. In Proceedings of OOPSLA’98, Vancouver, Canada, October 1998.
Satoshi Matsuoka, Hirotaka Ogawa, Kouya Shimura, Yasunori Kimura, Koichiro Hotta, and Hiromitsu Takagi. OpenJIT A Reflective Java JIT Compiler. In Proceedings of OOPSLA’98 Workshop on Reflective Programming in C++ and Java, November 1998.
Alexandre Olivia, Luis Eduardo Buzato, and Calciolari Islene. The Reflective Architecture of Guaraná. http://www.dcc.unicamp.br/oliva.
Insik Shin and John C. Mitchell. Java Bytecode Modification and Applet Security. Stanford CS Tech Report. 1998.
Robert J. Stroud. Transparency and Reflection in Distributed Systems. ACM Operating System Review, 22:99–103, April 1992.
Robert J. Stroud and Zhixue Wu. Using Metaobject Protocols to Satisfy Non-Functional Requirements. In Chris Zimmerman, editor, Advances in Object-Oriented Metalevel Architectures and Reflection, chapter 3, pages 31–52. CRC Press, Inc., 2000 Corporate Blvd., N.W., Boca Raton, Florida 33431, 1996.
Robert J. Stroud and Zhixue Wu. Using Meta-Object Protocol to Implement Atomic Data Types. In Walter Olthoff, editor, Proceedings of the 9th Conference on Object-Oriented Programming (ECOOP’95), LNCS 952, pages 168–189, Aarhus, Denmark, August 1995. Springer-Verlag.
Sun Microsystems, Inc. Java Development Kit version 1.3.0 Documentation. 2000.
Michiaki Tatsubori and Shigeru Chiba. Support of Design Patterns with Compile-time Reflection. In Shigeru Chiba and Jean-Charles Fabre, editors, Proceedings of OOPSLA Workshop on Reflective Programming in C++ and Java, Vancouver, Canada, November 1998.
Ian Welch and Robert J. Stroud. Dalang-A Reflective Extension for Java. Computing Science Technical Report CS-TR-672, University of Newcastle upon Tyne. 1999.
Ian Welch and Robert J. Stroud. From Dalang to Kava-The Evolution of a Reflective Java Extension. In Proceedings of Meta-Level Architectures and Reflection, Second International Conference, Reflection 1999, page 19–21. Saint-Malo, France. LNCS 1616, Springer. July 1999.
Ian Welch and Robert J. Stroud. Supporting Real World Security Models in Java. In Proceedings of 7th IEEE International Workshop on Future Treads of Distributed Computing Systems, pages 20–22. Cape Town, South Africa. TIEEE Computer Society. December 1999.
Zhixue Wu and Scarlet Schwiderski. Reflective Java-Making Java Even More Flexible. FTP: Architecture Projects Management Limited (http://apm@ansa.co.uk), Cambridge, UK. 1997.
Chris Zimmerman. Metalevels, MOPs and What all the Fuzz is All about. In Chris Zimmerman, editor, Advances in Object-Oriented Metalevel Architectures and Reflection, chapter 1, pages 3–24. CRC Press, Inc., 2000 Corporate Blvd., N.W., Boca Raton, Florida 33431, 1996.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Welch, I., Stroud, R.J. (2000). Kava - A Reflective Java Based on Bytecode Rewriting. In: Cazzola, W., Stroud, R.J., Tisato, F. (eds) Reflection and Software Engineering. OORaSE 1999. Lecture Notes in Computer Science, vol 1826. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45046-7_9
Download citation
DOI: https://doi.org/10.1007/3-540-45046-7_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-67761-1
Online ISBN: 978-3-540-45046-7
eBook Packages: Springer Book Archive