Module jni::objects [] [src]

Wrappers for object pointers returned from the JVM.

Structs

GlobalRef

A global JVM reference. These are "pinned" by the garbage collector and are guaranteed to not get collected until released. Thus, this is allowed to outlive the JNIEnv that it came from. Still can't cross thread boundaries since it requires a pointer to the JNIEnv to do anything useful with it.

JClass

Lifetime'd representation of a jclass. Just a JObject wrapped in a new class.

JFieldID

Wrapper around sys::jfieldid that adds a lifetime. This prevents it from outliving the context in which it was acquired and getting GC'd out from under us. It matches C's representation of the raw pointer, so it can be used in any of the extern function argument positions that would take a jfieldid.

JMap

Wrapper for JObjects that implement java/util/Map. Provides methods to get and set entries and a way to iterate over key/value pairs.

JMapIter

An iterator over the keys and values in a map.

JMethodID

Wrapper around sys::jmethodid that adds a lifetime. This prevents it from outliving the context in which it was acquired and getting GC'd out from under us. It matches C's representation of the raw pointer, so it can be used in any of the extern function argument positions that would take a jmethodid.

JObject

Wrapper around sys::jobject that adds a lifetime. This prevents it from outliving the context in which it was acquired and getting GC'd out from under us. It matches C's representation of the raw pointer, so it can be used in any of the extern function argument positions that would take a jobject.

JStaticMethodID

Wrapper around sys::jmethodid that adds a lifetime. This prevents it from outliving the context in which it was acquired and getting GC'd out from under us. It matches C's representation of the raw pointer, so it can be used in any of the extern function argument positions that would take a jmethodid. This represents static methods only since they require a different set of JNI signatures.

JString

Lifetime'd representation of a jstring. Just a JObject wrapped in a new class.

JThrowable

Lifetime'd representation of a jthrowable. Just a JObject wrapped in a new class.

Enums

JValue

Rusty version of the JNI C jvalue enum. Used in Java method call arguments and returns.