为了简化JVM层集群框架的配置,提高搭建JVM集群的效率,提出了一种共享类集的自动构建方法。通过对Java字节码的静态分析,对元素之间的依赖关系进行检测和处理。针对面向接口的编程模式,在分析依赖关系的基础上,提出了由抽象接口到具体业务类的依赖推导的解决方案,并自动检测和处理依赖的扩散,保证共享类集的完备性。该方法无需执行Java源代码,只需少数根对象便能自动便捷地实现共享类集的构建。利用OncePortal门户中间件进行了部署验证,验证结果表明了该方法的可行性和有效性。
To simplify the configuration of JVM-level cluster framework and improve the efficiency of constructing JVM cluster system, an automated method of constructing the shared class set is presented. Static analysis on Java byte-code is used to detect and process the dependencies between elements. Firstly, for the interface oriented programming pattern, a solution of dependency derivation from abstract interface to specific business class is proposed, based on dependencies analysis. Then, the diffusion of dependencies is detected and processed to ensure the completeness of the shared class set. Finally, the proposed method is applied and tested on OncePortal middleware system. It is demonstrated that the method is feasible and effective in auto-constructing the Shared Class Set from a minority of roots without executing the Java source code.