Commit Graph

7 Commits

Author SHA1 Message Date
Peter Johnson
51eb96903c Java: Improve robustness against JVM crashes on exit.
The JVM doesn't always do a good job of telling JNI modules that the JVM
is going away, which results in a crash in the JavaGlobal and/or
JavaWeakGlobal destructors as they try to delete the associated references
after the JVM has already gone away.

To protect against this, the Notifier now has a static variable that's set
when the Notifier instance (a singleton) is destroyed.  This is used by
JavaGlobal and JavaWeakGlobal to detect when a process exit is in process.
2015-09-14 22:00:22 -07:00
Peter Johnson
5181c4e5be Java: Don't free locals after detaching thread.
We use a smart pointer to hold local java variables, and it was getting
destructed after DetachCurrentThread() was called, causing a JVM crash.
2015-09-11 16:28:58 -07:00
Peter Johnson
702b6de734 Java: Fix crash on JVM exit.
Fixes #22.
2015-09-05 11:05:02 -07:00
Peter Johnson
969916851c Need to return nullptr, not false. 2015-08-28 17:17:20 -07:00
Peter Johnson
2b9e7c6af1 Silence MSVC warnings regarding bool conversions. 2015-08-28 14:07:51 -07:00
Peter Johnson
b971c741d7 Fix JNI for Windows and implement JNI getValue functions. 2015-08-28 13:52:16 -07:00
Peter Johnson
a990859db6 Initial commit of Java wrappers.
The JNI bindings are built directly into the shared library.  In the gradle
build, all built shared libraries are embedded into the generated jar.

Java bindings may be disabled via -DWITHOUT_JAVA (cmake) or -PskipJava=true
(gradle).

TODO:
- getEntryInfo() and RPC are not yet implemented.
- The cmake build doesn't integrate the built objects into the jar.
- The Java client and server tests are not built (but have been manually
  tested).

This has not yet been tested on Windows.
2015-08-28 12:43:49 -07:00