implement common jni library for zenoh-java and zenoh-kotlin#466
Open
implement common jni library for zenoh-java and zenoh-kotlin#466
Conversation
…ality-to-zenoh-kotlin
- Fix zenoh-ext Cargo.toml to include "unstable" feature (required for AdvancedPublisher/AdvancedSubscriber) - Add owned_object.rs: safe Arc accessor to prevent early drops - Add sample_callback.rs: SetJniSampleCallback trait for JNI callback wiring - Add ext/ module with JNI exports for AdvancedPublisher, AdvancedSubscriber, MatchingListener, SampleMissListener - Add openSessionViaJNI instance-method variant for zenoh-kotlin compatibility - Add prepare_publisher_builder and prepare_subscriber_builder helpers - Add declareAdvancedPublisherViaJNI and declareAdvancedSubscriberViaJNI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update zenoh and zenoh-ext versions from 1.8.0 to 1.9.0 - Align zenoh-ext features with main branch (only 'internal') - Update version.txt to 1.9.0 - Merge Cargo.lock changes from main Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The ext module requires unstable features from zenoh-ext. The merge removed this feature but the ext module still uses it, causing compilation errors. Also reordered module declarations to group feature-gated modules together per cargo fmt output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…kotlin Add @JvmStatic to openSessionViaJNI in JNISession companion object so Kotlin emits Java_io_zenoh_jni_JNISession_openSessionViaJNI (outer-class form) instead of the $Companion-suffixed variant. Remove the now-redundant Java_io_zenoh_jni_JNISession_00024Companion_openSessionViaJNI from session.rs, leaving the single canonical JNI binding that both zenoh-java and zenoh-kotlin share. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…enoh-java - Create zenoh-jni-runtime Gradle subproject with public primitive-only JNI adapters - Move JNI adapter classes (JNIConfig, JNIKeyExpr, JNISession, JNIPublisher, JNIQuery, JNIQuerier, JNIScout, JNILiveliness, JNISubscriber, JNIQueryable, JNILivelinessToken, JNIZenohId) from zenoh-java to zenoh-jni-runtime with public visibility and primitive APIs - Add new JNIAdvancedPublisher, JNIAdvancedSubscriber, JNIMatchingListener, JNISampleMissListener - Add new callback interfaces including JNIMatchingListenerCallback and JNISampleMissListenerCallback - Add public ZenohLoad expect/actual objects in zenoh-jni-runtime (jvm and android) - Add public Target enum in zenoh-jni-runtime jvmMain - Update zenoh-java/build.gradle.kts: depend on zenoh-jni-runtime, remove duplicate native build - Update Session.kt to inline callback assembly using runtime JNI adapters - Update Publisher.kt, Query.kt, Querier.kt, Liveliness.kt, Zenoh.kt to use primitive APIs - Fix Rust bug in session.rs: remove spurious let binding in declareAdvancedSubscriberViaJNI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ensure native library is loaded before calling startLogsViaJNI by touching ZenohLoad in Logger.start(). This makes Logger robust against direct internal calls that might bypass the usual Zenoh.kt initialization path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ZError was defined in both zenoh-jni-runtime and zenoh-java under the same FQCN (io.zenoh.exceptions.ZError). This caused duplicate-class packaging failures on JVM/Android when both artifacts were on the classpath. Fix: delete zenoh-java's copy so zenoh-jni-runtime is the single owner, and change the runtime dependency from implementation() to api() so that ZError (used in @throws across zenoh-java's public API) is properly re-exported to consumers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zenoh-jni-runtime is the single owner of Android Rust/JNI packaging. Remove the rust-android-gradle plugin, configureCargo() call, and mergeDebugJniLibFolders/mergeReleaseJniLibFolders task hooks from zenoh-java/build.gradle.kts so there is no duplication. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…otlin' of github.com:milyin-zenoh-zbobr/zenoh-java into zbobr_fix-68-adjust-zenoh-java-functionality-to-zenoh-kotlin
…enoh-java-functionality-to-zenoh-kotlin provide zenoh wrapper library common for zenoh-java and zenoh-kotlin
This comment was marked as resolved.
This comment was marked as resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The jni code is dupicated in java and kotlin. This update extacts jni library and makes it reutilizable for zenoh-kotlin
Implemented in milyin-zenoh-zbobr/tasks#68