简体   繁体   English

JNI从本机代码调用JVM函数/事件?

[英]JNI calling JVM functions/events from native code?

I am wondering if it is possible for native functions to signal Java functions/events? 我想知道本机函数是否有可能发出Java函数/事件的信号?

Basically I think I will run some C++ code on a separate thread and do stuff like handling SIP and then for example if the native thread detects an incomming call, being able to signal the JVM somehow. 基本上我认为我将在一个单独的线程上运行一些C ++代码并执行诸如处理SIP之类的操作,然后例如如果本机线程检测到一个接收调用,则能够以某种方式向JVM发送信号。 I am not sure how communication like this is done in JNI. 我不确定如何在JNI中完成这样的沟通。

Any ideas? 有任何想法吗?

There are several good articles around, like this one . 有几篇好文章,比如这篇文章。 Here's a Developer Works article that looks good too. 这是一篇看起来不错的Developer Works文章。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM