Skip to main content

Load-Time Structural Reflection in Java

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1850))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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.

    Google Scholar 

  2. 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.

    Article  Google Scholar 

  3. 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.

    Article  Google Scholar 

  4. 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.

    Google Scholar 

  5. Cohen, G. A., J. S. Chase, and D. L. Kaminsky, “Automatic Program Transformation with JOIE,” in USENIX Annual Technical Conference’ 98, 1998.

    Google Scholar 

  6. 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.

    Google Scholar 

  7. Dahm, M., “Byte Code Engineering with the JavaClass API,” Techincal Report B-17-98, Institut für Informatik, Freie Universität Berlin, January 1999.

    Google Scholar 

  8. Ellis, M. and B. Stroustrup, eds., The Annotated C++ Reference Manual. Addison-Wesley, 1990.

    Google Scholar 

  9. 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.

    Article  Google Scholar 

  10. Goldberg, A. and D. Robson, Smalltalk-80: The Language and Its Implementation. Addison-Wesley, 1983.

    Google Scholar 

  11. 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.

    Google Scholar 

  12. 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.

    Article  Google Scholar 

  13. Keller, R. and U. Hölzle, “Binary Component Adaptation,” in ECOOP’98-Object Oriented Programming, LNCS 1445, pp. 307–329, Springer, 1998.

    Chapter  Google Scholar 

  14. Kiczales, G., J. des Riviéres, and D. G. Bobrow, The Art of the Metaobject Protocol. The MIT Press, 1991.

    Google Scholar 

  15. Kirby, G., R. Morrison, and D. Stemple, “Linguistic Reflection in Java,” Software-Practice and Experience, vol. 28, no. 10, pp. 1045–1077, 1998.

    Article  Google Scholar 

  16. 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.

    Google Scholar 

  17. 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.

    Chapter  Google Scholar 

  18. 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.

    Google Scholar 

  19. Sun Microsystems, “Java™ 2 SDK Documentation.” version 1.3 (beta release), 1999.

    Google Scholar 

  20. 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.

    Chapter  Google Scholar 

  21. 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.

    Google Scholar 

  22. 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.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics