Cache jclass/jmethodID/jfieldID references

This patch introduces an initialization framework, which tracks required
references to Java classes and methods.

It works by declaring classes and their constructor signatures, which
are linked into a singly-linked list when the .so initializers are run.
Once JNI_OnLoad() is invoked, this list is walked and all classes and
their initializers are resolved. These are then used while the library
remains loaded. Once JNI_OnUnload() is called, global references are
released, so we can cleanly unload.

The class declaration results in static utility objects being emitted in
the scope of the declaration, hence to allocate an object or an array of
objects is done via simple calls.

Change-Id: I41984c13756339364dbcbf0144b947627e8e4fe1
Signed-off-by: Robert Varga <nite@hq.sk>
diff --git a/vpp-japi/Makefile.am b/vpp-japi/Makefile.am
index 5640dd1..f1eb37d 100644
--- a/vpp-japi/Makefile.am
+++ b/vpp-japi/Makefile.am
@@ -27,7 +27,7 @@
 
 lib_LTLIBRARIES += libvppjni.la
 
-libvppjni_la_SOURCES = japi/vppjni.c japi/vppapi.c
+libvppjni_la_SOURCES = japi/vppjni.c japi/vppapi.c japi/vppjni_env.h japi/vppjni_env.c
 libvppjni_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
 	              -lpthread -lm -lrt
 libvppjni_la_LDFLAGS = -module