Implementation of JNI 1.4 features in SableVM

Gregory Pakosz <[email protected]> Wed, 19 Jan 2005 18:20:54 +0100
Newsgroups gmane.comp.java.vm.sablevm.devel
Message-ID <[email protected]>
Hello,

As discussed with Etienne on IRC, here is a request for the 
implementation of the JNI 1.4 features:

http://java.sun.com/j2se/1.4.2/docs/guide/jni/jni-14.html
http://java.sun.com/j2se/1.4.2/docs/guide/jni/spec/jniTOC.html

I'm the lead architect and developer of the Java API of a C SDK that is 
coded in C language.
On IO operations, I use the new NIO features through the [ jobject 
NewDirectByteBuffer(JNIEnv* env, void* address, jlong capacity) ] 
function that allocates and returns a direct java.nio.ByteBuffer 
referring to the block of memory starting at the memory address address 
and extending capacity bytes.

The direct ByteBuffer is then passed to the read method of a 
ReadableByteChannel instance.

Also, the JNI_OnLoad function is implemented as:

JNIEXPORT jint JNICALL JNI_OnLoad(JavaMV* vm, void* reserved)
{
  return JNI_VERSION_1_4;
}


Best regards,
Gregory