Abstract
The standard reflection API of Java provides the ability to introspect a program but not to alter program behavior. This paper presents an extension to the reflection API for addressing this limitation. Unlike other extensions enabling behavioral reflection, our extension called Javassist enables structural reflection in Java. For using a standard Java virtual machine (JVM) and avoiding a performance problem, Javassist allows structural reflection only before a class is loaded into the JVM. However, Javassist still covers various applications including a language extension emulating behavioral reflection. This paper also presents the design principles of Javassist, which distinguish Javassist from related work.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Brant, J., B. Foote, R. E. Johnson, and D. Roberts, “Wrappers to the Rescure,” in ECOOP’98-Object Oriented Programming, LNCS 1445, pp. 396–417, Springer, 1998.
Braux, M. and J. Noyé, “Towards Partially Evaluating Reflection in Java,” in Proc. of Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM’00), SIGPLAN Notices vol. 34, no. 11, pp. 2–11, ACM, 1999.
Chiba, S., “A Metaobject Protocol for C++,” in Proc. of ACM Conf. on Object-Oriented Programming Systems, Languages, and Applications, SIGPLAN Notices vol. 30, no. 10, pp. 285–299, ACM, 1995.
Chiba, S. and T. Masuda, “Designing an Extensible Distributed Language with a Meta-Level Architecture,” in Proc. of the 7th European Conference on Object-Oriented Programming, LNCS 707, pp. 482–501, Springer-Verlag, 1993.
Cohen, G. A., J. S. Chase, and D. L. Kaminsky, “Automatic Program Transformation with JOIE,” in USENIX Annual Technical Conference’ 98, 1998.
Cointe, P., “Metaclasses are first class: The ObjVlisp model,” in Proc. of ACM Conf. on Object-Oriented Programming Systems, Languages, and Applications, pp. 156–167, 1987.
Dahm, M., “Byte Code Engineering with the JavaClass API,” Techincal Report B-17-98, Institut für Informatik, Freie Universität Berlin, January 1999.
Ellis, M. and B. Stroustrup, eds., The Annotated C++ Reference Manual. Addison-Wesley, 1990.
Fabre, J. C. and T. Pérennou, “A Metaobject Architecture for Fault Tolerant Distributed Systems: The FRIENDS Approach,” IEEE Transactions on Computers, vol. 47, no. 1, pp. 78–95, 1998.
Goldberg, A. and D. Robson, Smalltalk-80: The Language and Its Implementation. Addison-Wesley, 1983.
Golm, M. and J. Kleinöder, “Jumping to the Meta Level, Behavioral Reflection Can Be Fast and Flexible,” in Proc. of Reflection’ 99, LNCS 1616, pp. 22–39, Springer, 1999.
Hölzle, U. and D. Ungar, “A Third Generation Self Implementation: Reconciling Responsiveness with Performance,” in Proc. of ACM Conf. on Object-Oriented Programming Systems, Languages, and Applications, SIGPLAN Notices vol. 29, no. 10, pp. 229–243, 1994.
Keller, R. and U. Hölzle, “Binary Component Adaptation,” in ECOOP’98-Object Oriented Programming, LNCS 1445, pp. 307–329, Springer, 1998.
Kiczales, G., J. des Riviéres, and D. G. Bobrow, The Art of the Metaobject Protocol. The MIT Press, 1991.
Kirby, G., R. Morrison, and D. Stemple, “Linguistic Reflection in Java,” Software-Practice and Experience, vol. 28, no. 10, pp. 1045–1077, 1998.
Kleinöder, J. and M. Golm, “MetaJava: An Efficient Run-Time Meta Architecture for Java,” in Proc. of the International Workshop on Object Orientation in Operating Systems (IWOOS’96), IEEE, 1996.
Masuhara, H. and A. Yonezawa, “Design and Partial Evaluation of Meta-objects for a Concurrent Reflective Languages,” in ECOOP’98-Object Oriented Programming, LNCS 1445, pp. 418–439, Springer, 1998.
Ogawa, H., K. Shimura, S. Matsuoka, F. Maruyama, Y. Sohda, and F. Kimura, “OpenJIT: An Open-Ended, Reflective JIT Compiler Framework for Java,” in Proc. of ECOOP’2000, Springer Verlag, 2000. To appear.
Sun Microsystems, “Java™ 2 SDK Documentation.” version 1.3 (beta release), 1999.
Tatsubori, M., S. Chiba, M.-O. Killijian, and K. Itano, “OpenJava: A Class-based Macro System for Java,” in Reflection and Software Engineering (W. Cazzola, R. J. Stroud, and F. Tisato, eds)., LNCS 1826, Springer Verlag, 2000.
Welch, I. and R. Stroud, “From Dalang to Kava-The Evolution of a Reflective Java Extension,” in Proc. of Reflection’ 99, LNCS 1616, pp. 2–21, Springer, 1999.
Wu, Z., “Reflective Java and A Reflective-Component-Based Transaction Architecture,” in Proc. of OOPSLA’98 Workshop on Reflective Programming in C++ and Java (J.-C. Fabre and S. Chiba, eds)., 1998.
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
Chiba, S. (2000). Load-Time Structural Reflection in Java. In: Bertino, E. (eds) ECOOP 2000 — Object-Oriented Programming. ECOOP 2000. Lecture Notes in Computer Science, vol 1850. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45102-1_16
Download citation
DOI: https://doi.org/10.1007/3-540-45102-1_16
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-67660-7
Online ISBN: 978-3-540-45102-0
eBook Packages: Springer Book Archive