计算机应用 ›› 2010, Vol. 30 ›› Issue (2): 398-401.

• 计算机软件 • 上一篇    下一篇

嵌入式Java反射机制的设计与实现

丘志杰1,罗蕾2   

  1. 1. 电子科技大学
    2. 电子科技大学计算机学院
  • 收稿日期:2009-07-29 修回日期:2009-09-17 发布日期:2010-02-10 出版日期:2010-02-01
  • 通讯作者: 丘志杰

Research and implementation of embedded Java reflection mechanism

  • Received:2009-07-29 Revised:2009-09-17 Online:2010-02-10 Published:2010-02-01

摘要: Java反射是提高软件系统灵活性的重要技术,它是Java被视为动态语言的一个关键特性。虽然CLDC规范并不支持反射,但是在基于Java技术的嵌入式领域,反射仍有其应用需求。Sun公司根据CLDC规范发布了一套嵌入式Java技术的参考实现,其虚拟机被称作KVM。通过分析KVM的相关数据结构和机制,详细描述了反射机制的设计原理,并提出了一种在KVM中扩展反射功能的实现方案,经过测试证明该方案是可行的。

关键词: CLDC, KVM, Java, J2ME, 反射

Abstract: Java reflection is an important technology, which can improve software system flexibility and is a key feature for Java to be regarded as dynamic language. Though CLDC specification does not support reflection, it is still required in embedded area based on Java technology. Sun Microsystems released a reference implementation of embedded Java technology according to CLDC specification. The authors described the reflection design principle in detail by analyzing related data structure and mechanism of KVM, as well as it presented a method to extend reflection for KVM. The method is proved feasible by test.

Key words: Connected Limited Device Configuration (CLDC), K Virtual Machine (KVM), Java, Java 2 Micro Edition (J2ME), reflection