Computer Engineering and Applications ›› 2008, Vol. 44 ›› Issue (20): 7-10.DOI: 10.3778/j.issn.1002-8331.2008.20.003

• 博士论坛 • Previous Articles     Next Articles

Principle for automatic migrating from EJB2 to EJB3

LIU Lei1,2,NI Hong2,JI Zhi-hui1,2,KUANG Zhen-guo1,2   

  1. 1.Graduate University of Chinese Academy of Sciences,Beijing 100039,China
    2.National Network New Media Engineering Research Center,Institute of Acoustics,Chinese Academy of Sciences,Beijing 100080,China
  • Received:2008-02-18 Revised:2008-03-24 Online:2008-07-11 Published:2008-07-11
  • Contact: LIU Lei

一种自EJB2向EJB3的代码自动转换规则

刘 磊1,2,倪 宏2,嵇智辉1,2,匡振国1,2   

  1. 1.中国科学院 研究生院,北京 100039
    2.中国科学院 声学研究所 国家网络新媒体工程技术研究中心,北京 100080
  • 通讯作者: 刘 磊

Abstract: This paper,according to reference specifications of EJB2 and EJB3,provides a kind of principle for migrating the legacy EJB2-based applications to EJB3-based applications.The migrating is automatic and without any modifications of the legacy code of EJB clients.The automatic migration program is implemented using AST tools,and it’s successful to migrate XPETSTORE which is an EJB2 based demo application to EJB3 application with the software.

Key words: Enterprise JaveBeans(EJB), JPA, migration, Abstract Syntax Tree(AST)

摘要: 参考EJB2和EJB3相关的规范,提出一种自EJB2向EJB3代码自动转换规则,解决目前基于EJB2组件的应用已被业界接受和广泛部署的情况下,EJB2组件代码自动转换为EJB3代码的问题。提出的转换规则保证了EJB2的客户端在不修改代码的情况下访问转换后的EJB3组件。利用抽象语法树AST(Abstract Syntax Tree)解析和创建Java代码,按照该转换规则,所实现的转换软件已经成功转换了XPETSTORE示例。

关键词: 企业级Java组件, Java持久API, 代码转换, 抽象语法树