首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 31 毫秒
1.
JNI技术在跨平台电力自动化系统中的应用   总被引:1,自引:0,他引:1  
赵楠  何光宇 《计算机工程与应用》2005,41(17):203-205,232
Java的平台无关等优点使它更适合电力系统的软件开发。但目前电力系统的大部分软件都是用C 语言中开发的,如何能将原有程序应用到Java中成为一个值得关注的问题。论文以配电分析软件为例,探讨使用Java本地接口(JNI)改造原有C 程序的可行性和优点,并对Java本地接口技术在电力系统自动化软件中的应用前景进行了展望。  相似文献   

2.
ActiveX控件为Windows平台下的一种构件模型,具有良好的封装性和复用性。探讨了ActiveX控件在Java程序中的应用,通过JNI技术作为桥梁,以同位体的方法实现了GUI界面管理,通过JNI本地化方法实现了ActiveX控件方法调用与属性设置,以及使用代理模式实现应用Java代码来处理ActiveX控件的事件。经实际项目验证,所提出的方法可行且具有借鉴意义。  相似文献   

3.
A Foreign Function Interface (FFI) allows one host programming language to interoperate with another foreign language. It enables efficient software development by permitting developers to assemble components in different languages. One typical FFI is the Java Native Interface (JNI), through which Java programs can invoke native-code components developed in C, C++, or assembly code. Although FFIs bring convenience to software development, interface code developed in FFIs is often error prone because of the lack of safety and security enforcement. This paper introduces a static-analysis framework, TurboJet, which finds exception-related bugs in JNI applications. It finds bugs of inconsistent exception declarations and bugs of mishandling JNI exceptions. TurboJet is carefully engineered to achieve both high efficiency and accuracy. We have applied TurboJet on a set of benchmark programs and identified many errors. We have also implemented a practical Eclipse plug-in based on TurboJet that can be used by JNI programmers to find errors in their code.  相似文献   

4.
改进的Java类文件保护方法   总被引:1,自引:1,他引:0       下载免费PDF全文
编译后的Java类文件很容易被反编译,在Java应用上会产生源代码的安全问题。该文对传统的Java类文件保护方法进行分析,在类加载器(ClassLoader)加密技术的基础上,提出一种使用JNI技术调用本地解密接13的改进方法。解密接口在设计上保证了JNI技术调用本地解密接口时的通信安全,从而提升了Java类文件的安全性。实验结果表明,该方法是有效的。  相似文献   

5.
JNI是JDK提供的本地编程接口,它允许Java代码操作其他语言编写的应用程序和库,但调用本地方法的同时也带来了安全问题.CORBA是一个分布式的、面向对象的应用架构规范,它允许对象在异构的、分布式的环境中透明传输,从而也能实现Java与C/C+ +的互操作.本文比较了JNI和CORBA两种方法的优缺点,并将CORBA应用在一个J2EE架构下的项目中,解决了项目中Java与C/C+ +的交互问题.  相似文献   

6.
The safety and reliability of software is influenced by the choice of implementation language and the choice of programming idioms. C++ is gaining popularity as the implementation language of choice for large software projects because of its promise to reduce the complexity and cost of their construction. But is C++ an appropriate choice for such projects? An assessment of how well C++ fits into recent software guidelines for safety critical systems is presented along with a collection of techniques and idioms for the construction of safer C++ code.  相似文献   

7.
Using roles in object‐oriented design leads to a more natural representation of a given problem domain. Despite a lot of research into role–based systems, there is still a gap between conceptual representations of roles and the usage of roles in strongly typed object‐oriented programming languages such as C++ or Java. Since these languages associate classes and their instances exclusively and permanently, representing evolving objects that may take on different roles over time is difficult without special support: (i) entities must be reclassified any time they evolve and (ii) class hierarchies may grow exponentially if entities may take on several independent roles. This article shows how role hierarchies can be easily implemented in Java. It introduces the Java Role Package, which provides a set of classes to support handling of evolving objects without modifying the semantics of Java itself. Copyright © 2004 John Wiley & Sons, Ltd.  相似文献   

8.
A message-passing class library C++ for portable parallel programming   总被引:1,自引:1,他引:0  
An object-oriented message-passing class library in C++, called PPI++, for portable parallel programming has been developed. PPI++ (parallel portability interface in C++) is designed to serve as a stable (unchanging) interface between the client parallel code and the rapidly evolving distributed computing environments. By taking advantage of encapsulation, inheritance, and polymorphism supported by C++, PPI++ provides a clean and consistent programming interface, which helps improve the clarity and expressiveness of client parallel codes and hides implementation details and complexity from the user to ease parallel programming tasks. In addition, the use of strong type-checking in C++ allows the detection of potential misuses of the library at compile time, and thus promotes code reliability. This paper describes the object-oriented design and implementation of PPI++. Evaluation of PPI++ on important performance issues, such as portability, ease-of-use, extensibility, and efficiency, is also discussed.  相似文献   

9.
Modern systems for the analysis of image‐based biomedical data, such as functional magnetic resonance imaging (fMRI), require fast computational techniques and rapid, robust development. Object‐oriented programming languages such as Java and C++ provide the foundations for the development of complex data analysis applications. This case study explores the advantages and disadvantages of using these two programming environments for scientific computation as typified in the analysis of fMRI datasets. C++ is well suited for computational and memory optimization while Java is more compliant to the object‐oriented paradigm, supports cross‐platform development and has a rich set of application programming interface (API) classes. The same data model and algorithms were implemented in C++ and Java, and a user interface was developed with the Java API. Comparisons were made with respect to computational performance and ease of development. Benchmarks show that C++ generally outperforms Java, while Java is easier to use, leading to more robust code and shorter development times. However, with the advent of newer just‐in‐time compilers, Java performance is at times comparable to C++. The latest Java virtual machine technology is closing the gap and eventually Java should be a good compromise between efficient algorithm performance and effective application development. Copyright © 2004 John Wiley & Sons, Ltd.  相似文献   

10.
An approach to recovering design-level UML class models from C++ source code to support program comprehension is presented. A set of mappings are given that focus on accurately identifying such elements as relationship types, multiplicities, and aggregation semantics. These mappings are based on domain knowledge of the C++ language and common programming conventions and idioms. Additionally, formal concept analysis is used to detect design-level attributes of UML classes. An application implementing these mappings is used to reverse engineer a moderately sized, open-source application and the resultant class model is compared against those produced by other UML reverse engineering tools. This comparison shows that the presented mapping rules effectively produce meaningful and semantically accurate UML models.  相似文献   

11.
在Java中访问自动化COM组件   总被引:1,自引:0,他引:1  
与其他编程语言相比,Java有很多优点,尽管如此,你常常希望在你的代码中访问其他语言写的应用或者程序库,尤其是COM组件。标准Java没有对COM提供支持,但是,你可以对自动化COM组件主要是COM组件的Idispatch接口进行封装,然后通过使用Java本地接口(JNI)来访问COM组件。  相似文献   

12.
Convenient use of legacy software in Java with Janet package   总被引:2,自引:0,他引:2  
This paper describes Janet package — highly expressive Java language extension that enables convenient creation of powerful native methods and efficient Java-to-native code interfaces. Java native interface (JNI) is a low-level API that is rather inconvenient if used directly. Therefore Janet, as the higher-level tool, combines flexibility of JNI with Java’s ease-of-use. Performance results of Janet-generated interface to the lip library are shown. Java code, which uses lip, is compared with native C implementation.  相似文献   

13.
与其他编程语言相比,Java有很多优点,尽管如此。你常常希望在你的代码中访问其他语言写的应用或者程序库.尤其是COM组件。标准Java没有对COM提供支持,但是。你可以对自动化COM组件主要是COM组件的ldispatch接口进行封装,然后通过使用Java本地接口(JNI)采访问COM组件。  相似文献   

14.
15.
动态多态性提高了代码的可重用性和程序执行时的灵活性。本文详细讨论了C++语言对动态多态的支持机制,并结合例子说明了动态多态在程序设计中的应用。  相似文献   

16.
Iain Milne  Glenn Rowe 《Software》2005,35(15):1477-1493
Although the principles of writing compilers and interpreters are well known, we have found that the ideas needed to develop an interpreter for the express purpose of allowing direct interaction with the running code do not yet appear to have been published in an academic context. We describe a programming method that can be used for the production of an interpreter for common object‐oriented languages such as C++, Java and C#. The main purpose of the interpreter is to parse short, relatively simple programs and allow direct interaction between the user and the running code. Such a system is useful for projects such as OGRE, which is an educational tool allowing students to visualize in three‐dimensional graphics the state of a program as it runs. The interpreter works by first parsing the source code and building up a data structure capable of representing the program's source code in a form that can be used to both run the program and extract detailed information from the running program. This extraction allows for novel uses of the interpreter, such as forming the basis for a visualization system that must display and provide such information to the user as they watch their executing program. This paper considers the construction of such an interpreter specifically for C++, but the principles should be the same for other similar languages such as Java and C#. We cover the main tasks required of the programmer to create and use the data structure, highlighting areas such as its design, initial construction during parsing, and techniques required to use it for interpretation. These include the ability for the data structure to intelligently clone subsets of itself when multiple copies of one of its elements are required by the running program, how it handles C++'s complicated function overloading and overriding rules, and how inheritance and polymorphism can be supported. Copyright © 2005 John Wiley & Sons, Ltd.  相似文献   

17.
Because they are interpreted, Java executables run slower than their compiled counterparts. The native executable translation (NET) compiler's objective is to optimize the translation of Java byte-code to native machine code so that it runs nearly as fast as native code generated directly from a source. The article presents some preliminary results for several large application programs and standard benchmarks. It compares the NET-compiled code performance with Sun's Java VM, Microsoft's Java just-in-time compiler, and equivalent C and C++ programs directly compiled. The results show that the optimizing NET compiler is capable of achieving better performance than the two other byte-code execution methods, in some cases achieving speeds comparable to directly compiled native code  相似文献   

18.
Android Java应用程序(APP)运行时需依赖Dalvik虚拟机环境,从而影响APP的性能表现.C/C++程序具有极好的硬件适应能力,但不能直接开发Android APP.针对该问题,利用Dalvik虚拟机支持JNI (Java Native Inter-face)调用的特点,设计了基于Qt的Android APP C/C++开发方法框架体系,给出了框架的详细工作机制和解决方案,系统总结了利用C/C++开发Android APP的主要过程和步骤.最后,以Android版机械CAD导教APP的开发工作为例,验证了方法的有效性和可行性,为直接利用C/C++开发Android APP提供了一种新途径.  相似文献   

19.
Implementing a concurrent programming language such as Java by means of a translator to an existing language is attractive as it provides portability over all platforms supported by the host language and reduces development time—as many low‐level tasks can be delegated to the host compiler. The C and C++ programming languages are popular choices for many language implementations due to the availability of efficient compilers on a wide range of platforms. For garbage‐collected languages, however, they are not a perfect match as no support is provided for accurately discovering pointers to heap‐allocated data on thread stacks. We evaluate several previously published techniques and propose a new mechanism, lazy pointer stacks, for performing accurate garbage collection in such uncooperative environments. We implemented the new technique in the Ovm Java virtual machine with our own Java‐to‐C/C++ compiler using GCC as a back‐end compiler. Our extensive experimental results confirm that lazy pointer stacks outperform existing approaches: we provide a speedup of 4.5% over Henderson's accurate collector with a 17% increase in code size. Accurate collection is essential in the context of real‐time systems, we thus validate our approach with the implementation of a real‐time concurrent garbage collection algorithm. Copyright © 2009 John Wiley & Sons, Ltd.  相似文献   

20.
采用 C++编写的软件一直是二进制逆向分析中的高难度挑战, 二进制代码中不再保留 C++中的类及其继承信息, 尤其是正式发布的软件缺省开启编译优化, 导致残留的信息也被大幅削减, 使得商业软件(Commercial-Off-The-Shelf, COTS)的 C++二进制逆向分析尤其困难。当前已有的研究工作一是没有充分考虑编译优化, 导致编译优化后类及其继承关系的识别率很低, 难以识别虚继承等复杂的类间关系; 二是识别算法执行效率低, 无法满足大型软件的逆向分析。本文围绕编译优化下的 C++二进制代码中类及其继承关系的识别技术开展研究, 在三个方面做出了改进。第一, 利用过程间静态污点分析从 C++二进制文件中提取对象的内存布局, 有效抵抗编译优化的影响(构造函数内联); 第二, 引入了四种启发式方法, 可从编译优化后的 C++二进制文件中恢复丢失的信息; 第三, 研发了一种自适应 CFG(控制流图)生成算法, 在极小损失的情况下大幅度提高分析的效率。在此基础上实现了一个原型系统 RECLASSIFY, 它可以从 C++二进制代码中有效识别多态类和类继承关系(包括虚继承)。实验表明, 在 MSVC ABI 和 Itanium ABI 下, RECLASSIFY 均能在较短时间内从优化后二进制文件中识别出大多数多态类、恢复类关系。在由 15 个真实软件中的 C++二进制文件组成的数据集中(O2 编译优化), RECLASSIFY 在 MSVC ABI 下恢复多态类的平均召回率为 84.36%, 而之前最先进的解决方案 OOAnalyzer 恢复多态类的平均召回率仅为 33.76%。除此之外, 与OOAnalyzer 相比, RECLASSIFY 的分析效率提高了三个数量级。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号