dmsc/java/
mod.rs

1//! Copyright © 2025-2026 Wenze Wei. All Rights Reserved.
2//!
3//! This file is part of DMSC.
4//! The DMSC project belongs to the Dunimd Team.
5//!
6//! Licensed under the Apache License, Version 2.0 (the "License");
7//! You may not use this file except in compliance with the License.
8//! You may obtain a copy of the License at
9//!
10//!     http://www.apache.org/licenses/LICENSE-2.0
11//!
12//! Unless required by applicable law or agreed to in writing, software
13//! distributed under the License is distributed on an "AS IS" BASIS,
14//! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15//! See the License for the specific language governing permissions and
16//! limitations under the License.
17
18//! # Java JNI Bindings Module
19//!
20//! This module provides Java JNI bindings for DMSC, enabling Java applications
21//! to use DMSC functionality through native method calls.
22//!
23//! ## Key Components
24//!
25//! - **jvm**: JVM lifecycle management
26//! - **converter**: Rust-Java type conversion utilities
27//! - **exception**: Java exception handling
28//! - **classes**: JNI bindings for all DMSC classes
29//!
30//! ## Design Principles
31//!
32//! 1. **API Consistency**: Java API matches Rust API exactly
33//! 2. **Memory Safety**: Proper handling of native pointers
34//! 3. **Error Handling**: Rust errors converted to Java exceptions
35//! 4. **Thread Safety**: Safe for concurrent access from Java
36
37pub mod jvm;
38pub mod converter;
39pub mod exception;
40pub mod classes;
41
42pub use jvm::DMSCJavaContext;
43pub use converter::{JavaConvertible, ToJava, FromJava};
44pub use exception::{DMSCJavaException, throw_exception};