tailieunhanh - The Java Native InterfaceProgrammer’s Guide and Specification phần 7

Các đường chấm trong hình trên đại diện cho các mối quan hệ đoàn giữa các bộ tải lớp. Một bộ nạp lớp có thể yêu cầu một bộ nạp lớp để tải một lớp hoặc một giao diện thay mặt của nó. Ví dụ, cả L1 và L2 ủy quyền cho bộ nạp lớp bootstrap để tải các lớp hệ thống . Phái đoàn cho phép các lớp hệ thống để được chia sẻ | JNIFUNCTIONS The JNIEnv Interface Reflection Support FromReflectedField converts instances of in the Java Core Reflection API into field IDs. FromReflectedField is new in Java 2 SDK release . FromReflectedMethod converts instances of or instances of into method IDs. From-ReflectedMethod is new in Java 2 SDK release . ToReflectedField and ToReflectedMethod carry out the conversions in the opposite direction. Both functions are new in Java 2 SDK release . The flexibility of an interface pointer makes it easy to evolve the JNIEnv interface. A future version of the JNI specification could introduce a new interface say a JNIEnv2 interface that is different from the current version of the JNIEnv. A future virtual machine implementation can maintain backward compatibility by simultaneously supporting both JNIEnv and JNIEnv2 interfaces. The return value of the JNI_OnLoad handler of a native library informs the virtual machine implementation about the version of the JNI interface expected by the native library. For example a native library can presently implement a native method using a native function Java_Foo_f as follows JNIEXPORT void JNICALL Java_Foo_f JNIEnv env jobject this jint arg . env - . some call to the JNIEnv interface In the future the same native method may also be implemented as follows possible implementation of using a hypothetical future version JNI_VERSION_2_0 of the JNI interface JNIEnv2 g_env JNIEXPORT jint JNICALL JNIOnLoad JavaVM vm void reserved jint res cache JNIEnv2 interface pointer in global variable res vm - GetEnv vm void g_env JNI_VERSION_2_0 if res 0 return res return JNI_VERSION_2_0 the required JNI version 179 Specification of JNI Functions JNI FUNCTIONS JNIEXPORT void JNICALL Java_Foo_f jobject this jint arg . g_env - . some call to the JNIEnv2 interface To highlight interface evolution we have made the hypothetical future JNIEnv2 .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.