共查询到20条相似文献,搜索用时 406 毫秒
1.
2.
JNI是JDK提供的本地编程接口,它允许Java代码操作其他语言编写的应用程序和库,但调用本地方法的同时也带来了安全问题.CORBA是一个分布式的、面向对象的应用架构规范,它允许对象在异构的、分布式的环境中透明传输,从而也能实现Java与C/C+ +的互操作.本文比较了JNI和CORBA两种方法的优缺点,并将CORBA应用在一个J2EE架构下的项目中,解决了项目中Java与C/C+ +的交互问题. 相似文献
3.
The JavaTM Native Interface (JNI) provides a set of mechanisms for implementing Java methods in C or C++. JNI is useful for reusing C and C++ code repositories within Java frameworks. JNI is also useful for real‐time systems, where compiled C/C++ code executes performance‐critical tasks, while Java code executes system control and feature tasks. Available JNI literature concentrates on creating Java proxy classes that allow Java clients to interact with C++ classes. Current JNI literature does not discuss Java proxies for entire C++ inheritance hierarchies; that is the topic of this paper. Our experience in reusing C++ class hierarchies within a Java framework has uncovered a set of useful techniques for constructing Java proxy class hierarchies that mirror their C++ counterparts. This report gives both high level design guidelines and specific programming idioms for constructing Java class hierarchies that serve as proxies for C++ counterparts. We begin by discussing opportunities for reuse within a proxy class hierarchy, as well as problems caused by differences between the Java and C++ approaches to inheritance. The two most significant differences are due to C++ support for invocation of a member function based on the static type of its class, and C++ support for multiple implementation inheritance. Two example C++ class hierarchies provide the basis for a set of sections that present the design guidelines and that codify the programming idioms. This work could serve as the basis for an automatic generator of Java proxy class hierarchies. Copyright © 2000 John Wiley & Sons, Ltd. 相似文献
4.
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. 相似文献
5.
针对当前Intel集成众核协处理器(MIC)只能使用C/C+〖KG-*3〗+/Fortran编程语言进行并行计算,不能对已有的Java程序提供高性能计算支持的问题,提出基于Java Native Interface(JNI)技术和C+〖KG-*3〗+的MIC混合并行计算方法。该方法基于JNI设计Java代码与C+〖KG-*3〗+代码的数据交换机制,使MIC协处理器强大的浮点计算能力加速Java应用程序成为可能。通过实验测试分析基于MIC多线程并行的Java程序计算性能效果,结果表明该方法能有效利用MIC协处理器,对Java程序的计算性能提升显著。 相似文献
6.
JNI技术在跨平台电力自动化系统中的应用 总被引:1,自引:0,他引:1
Java的平台无关等优点使它更适合电力系统的软件开发。但目前电力系统的大部分软件都是用C 语言中开发的,如何能将原有程序应用到Java中成为一个值得关注的问题。论文以配电分析软件为例,探讨使用Java本地接口(JNI)改造原有C 程序的可行性和优点,并对Java本地接口技术在电力系统自动化软件中的应用前景进行了展望。 相似文献
7.
本文介绍了如何用Java实现粒子模拟的面向对象的并行程序设计方法,并在由16个Pentium Ⅲ 1.6G CPU组成的微机机群上测试了其性能。同时,为了提高它的计算性能,我们还介绍了利用JNI实现Java和Fortran混合编程的方法,即把程序中计算量较大的部分用Fortran语言代替,以提高其计算性能。结果表明,Java/Fortran混合编程是进行科科学计算的一种有效途径。 相似文献
8.
ActiveX控件为Windows平台下的一种构件模型,具有良好的封装性和复用性。探讨了ActiveX控件在Java程序中的应用,通过JNI技术作为桥梁,以同位体的方法实现了GUI界面管理,通过JNI本地化方法实现了ActiveX控件方法调用与属性设置,以及使用代理模式实现应用Java代码来处理ActiveX控件的事件。经实际项目验证,所提出的方法可行且具有借鉴意义。 相似文献
9.
10.
11.
12.
本文介绍了Java和OPC相结合的技术,并以连接到OPC报警与事件服务器为例,介绍了用Java/JNI技术编写OPC客户端应用程序的详细过程。 相似文献
13.
14.
针对移动机器人的任务和硬件组成,提出了基于Java 开发平台的Agent控制系统设计方法。以目前应用较广泛的JADE作为Agent开发平台,采用JNI方法实现了Agent与硬件系统的交互。在运动控制卡上设计了有实时性要求的轨迹生成、运动控制、位姿估计和安全控制等4个行为任务,将数据库和路径规划等管理性行为设计在车载PC104工业控制计算机上。人机交互界面可作为独立的Agent驻留在上位监控计算机上。这种方法结合了Java Agent开发平台的普遍性和工业控制的实时性,实验证明了该方法的可行性。 相似文献
15.
16.
基于JNI的COM组件调用 总被引:2,自引:0,他引:2
介绍了Java语言本地方法.JNI及COM组件技术,并结合课件转换工具的实例讲述了如何在.java中调用COM组件,实现了java与COM技术的结合,有较高的应用价值,但COM技术主要应用于Windows平台,对Java平台的独立性有一定程度的影响。 相似文献
17.
在分析JNI技术框架的基础上,通过实例展示了一种如何实现Java与C++之间通信的方法。实践证明,该方法具有较高的实用价值。 相似文献
18.
19.
本文以分子力学计算为例,提出了一个化学计算软件网格化的思路.目前已有的化学计算软件多为单机版本,以高级编程语言如FORTRAN、C/C 等编制而成,本文采用JNI技术与Globus Toolkit 4软件相结合的方法对分子力学C 计算程序进行封装,基于Java语言和Web Service实现了它的网格化,对计算程序的内部核心未做改动.本文的技术路线可用于其他化学计算软件向网格环境方便、有效地移植. 相似文献
20.
在Java中访问自动化COM组件 总被引:1,自引:0,他引:1
来社安 《数字社区&智能家居》2006,(11)
与其他编程语言相比,Java有很多优点,尽管如此,你常常希望在你的代码中访问其他语言写的应用或者程序库,尤其是COM组件。标准Java没有对COM提供支持,但是,你可以对自动化COM组件主要是COM组件的Idispatch接口进行封装,然后通过使用Java本地接口(JNI)来访问COM组件。 相似文献