6.5. Embed Java Virtual Machine into a Native Program Domain

6.5.1. Overview

In the previous sections, we discussed how to call native methods from within the Java domain and execute the associated functionalities defined in the native methods to complete some special requirements that are inconvenient to perform in the Java domain. That is one of the advantages of using the JNI and native library. A modification to this situation is that the native methods have callback ability and they can access and modify either variables (fields) or methods (instance methods or class methods) defined in the Java domain from within the native domain. But anyway, no matter if the native method has a callback ability or not, it must be activated by a call from ...

Get Applications Interface Programming Using Multiple Languages: A Windows® Programmer's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.