ODMdev: ActiveODMA Development Framework

devNote d061101
Java-OdmNative Bridge


0.06 2008-04-23 21:12 -0700

{Preliminary Material.  Recast this and move the progression information somewhere else, or include it in the individual pages where it comes into play.  The is material might be better included in the deployment treatment and in project documents also.}

1. Overview

ODMJNI 1.0 is developed via evolutionary prototyping of components along multiple tracks:

In the evolution on each track, there are both free-standing and integrated confirmation tests.  The results of the free-standing tests are designed to establish that there is a worked solution that the integrated case should be verifiable against.

The major integration and coordination effort involves odmjni100, where all tracks come together.  Here is the greatest need for careful synchronization.  The odmjni100 progression is constrained by the current levels of practical100.  The needs of odmjni100 introduce requirements for new levels of OdmNative100.

2. Progression

info.odma.odmjni100 is a Java package of classes that deliver ODMA-aware operations to applications via the info.odma.practical100 interfaces:

  1. The odmjni100 classes use private native methods and the Java Native Interface (JNI) to access native Windows and ODMA functions.
  2. The implementations of the native methods are provided by the odmjni100.dll Dynamic-Link Library (DLL).
  3. Functions implemented in odmjni100.dll construct instances of OdmNative100 objects and their IodmNative100 interfaces.
  4. The odmjni100 classes implement their practical100 ODMA-aware operations by requests to IodmNative100 methods.  These requests are via native odmjni100 "helper" methods.
  5. The linkage between odmjni100 methods and IodmNative100 methods is by retaining pointers to the IodmNative100 interfaces in the odmjni100 objects.  These pointers are disguised as Java long values.
  6. odmjni100 classes are designed to hold onto those disguised pointer values so long as any native helper method might be called. 
  7. IodmNative100 operations are obtained by passing the disguised interface pointer to each native helper method as one of the parameters.  The native helper method's implementation in odmjni100.dll uses the passed-back pointer to find the IodmNative100 interface that was created for the odmjni100 object to use (3, above).
  8. When the odmjni100 object releases its resources, no later than finalization, it uses helper methods to release all IodmNative100 interfaces being held, setting the Java long values back to 0 to signify that no interface is being held.  Any subsequent access to odmjni100 native helper methods of the object will result in null responses. 

In this manner, the lifetime of resources held by OdmNative100 objects is synchronized with the lifetime and usage of the odmjni100 objects.  The retention of odmjni100.dll in computer memory is managed by the Java Virtual Machine.

3. References and Resources

Liang, Sheng.
The Java Native Interface: Programmer's Guide and Specification.  Addison-Wesley (Reading, MA: 1999).  ISBN 0-201-32577-2 pbk.  Available at <http://java.sun.com/docs/books/jni/> with different electronic editions and downloadable examples.  The HTML version pages are dated 2002-03-07. Accessed 2006-11-11.
Sun Microsystems.
Java Native Interface Tips.  Web page, updated 1999 December 2.  Available at <http://java.sun.com/products/jdk/faq/jnifaq.html>.  Accessed 2006-11-11.
Sun Microsystems.
Java Native Interface 5.0 Specification.  Undated on-line document.  Available at <http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html>.  This document, as of 2005-08-26, is also available in the 2005-11-18 jdk_1.5.0_doc.zip download of the J2SE (TM) Development Kit Documentation 5.0 (English) available via <http://java.sun.com/javase/downloads/index.jsp>.  Accessed 2006-09-08.

4. Available Material

Revision History:
0.06 2007-12-01-13:48 Added Link to Confirmation Tests
0.05 2007-09-25-13:55 Reflect Initiation of 0.59beta
The 0.59beta Integration is introduced and the text and links are revised to tie directly to the related developments and the separate packaging project.
0.04 2007-03-05-17:30 Correct the placeholders for the substitution of 0.57beta for 0.56beta
This is done to accelerate availability of an openKnownDocument implementation for testing with the Java application
0.03 2007-02-24-18:13 Update with placeholders for the progression through 0.58beta.
0.02 2006-12-20-19:03 Link to 0.300.25alpha Integration
This page is badly in need of repaving.  Later.
0.01 2006-11-26-14:55 Complete Summary
Provide basic sketch and context and be a placeholder for tying in the code drops on further pages.
0.00 2006-11-09-13:48 create placeholder to morph into the necessary material
Incorporate job jar and use it to drive the completion of essential items here, providing an initial skeleton for more content.  The first objective is creating a jobjar and placeholder pages to be used while the component is taken through critical feasibility tests.

Construction Structure (Hard Hat Area)

Creative Commons License You are navigating ODMdev.
This work is licensed under a
Creative Commons Attribution 2.5 License.

created 2006-11-09-13:48 -0800 (pst) by orcmid
$$Author: Orcmid $
$$Date: 08-04-23 21:12 $
$$Revision: 78 $