Java native interface code generator
First Claim
1. A mixed language programming method for making a function or procedure written in a native language accessible to a Java application, said method comprising the steps of:
- receiving a native interface description that describes said function or procedure;
parsing said native interface description; and
processing said parsed native interface description to generate data conversion code stubs containing Java Native Interface functions required to implement said function or procedure and a Java class definition for said function or procedure, wherein said function or procedure, said data conversion code stubs and said Java class communicate directly by means of the Java Native Interface.
2 Assignments
0 Petitions
Accused Products
Abstract
A Java native interface code generator is disclosed to facilitate mixed language programming, by making native code programmed in a native language accessible to Java application programs. A programmer generates a native interface definition for native code, preferably using a neutral Interface Definition Language (IDL) to describe native code components (functions, data structures, constants and other user-defined data types), for which native mappings are to be generated. The Java native interface code generator supports complex data types, including nested data structures and multi-dimensional arrays. The Java native interface code generator reads and parses the user-derived native interface definition and generates Java Classes, data conversion code stubs and related header files. The Java Classes consist of classes of native methods, as well as classes for complex data types, which are called from Java. Each native method is mapped to a function or procedure written in the native code, using the Java Native Interface (JNI). The data conversion code stubs (JNI code) convert and map the native data and functions between the native language and Java. The Java class generated for complex data types, such as structures and unions, extends another Java class, JStruct or JUnion, respectively. The JStruct and JUnion classes implement Java Serializable and Cloneable interfaces and provides the core functionality for all data structures and unions, respectively, mapped to Java objects. Each Java data structure and union "extends" the JStruct or JUnion class and thereby inherits the behavior and characteristics of the JStruct or JUnion class, including memory management features. The JStruct and JUnion classes preferably provide methods for converting between members of a native language data structure or union, as appropriate, and fields of a Java object, as well as additional memory management functionality.
262 Citations
20 Claims
-
1. A mixed language programming method for making a function or procedure written in a native language accessible to a Java application, said method comprising the steps of:
-
receiving a native interface description that describes said function or procedure; parsing said native interface description; and processing said parsed native interface description to generate data conversion code stubs containing Java Native Interface functions required to implement said function or procedure and a Java class definition for said function or procedure, wherein said function or procedure, said data conversion code stubs and said Java class communicate directly by means of the Java Native Interface. - View Dependent Claims (2, 3, 4)
-
-
5. A mixed language programming method of making a data structure written in a native language accessible to a Java application, said method comprising the steps of:
-
defining a data structure Java class specifying functionality and characteristics that apply to Java data structures; receiving a native interface description that describes said native data structure; parsing said native interface description; and processing said parsed native interface description to generate a Java class for said native data structure that extends said data structure Java class, said Java class for said native data structure inheriting said functionality and characteristics of said data stricture Java class. - View Dependent Claims (6, 7, 8, 9, 10)
-
-
11. A mixed language programming method of making a union written in a native language accessible to a Java application, said method comprising the steps of:
-
defining a union Java class specifying functionality and characteristics that apply to Java unions; receiving a native interface description that describes said native union; parsing said native interface description; and processing said parsed native interface description to generate a Java class for said native union that extends said union Java class, said Java class for said native union inheriting said functionality and characteristics of said data structure Java class. - View Dependent Claims (12, 13, 14, 15, 16)
-
-
17. A mixed language programming method for making a function or procedure written in a native language accessible to a Java application, said function or procedure having native code components, said method comprising the steps of:
-
generating a description of said native code components using a neutral description language; parsing said native interface description; and processing said parsed native interface description to automatically generate data conversion code stubs containing Java Native Interface functions required to implement said function or procedure and a Java class definition for said function or procedure and any complex data types utilized by said method, wherein said function or procedure, said data conversion code stubs and said Java class communicate directly by means of the Java Native Interface. - View Dependent Claims (18, 19, 20)
-
Specification