aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-japi/japi/vppjni.h
diff options
context:
space:
mode:
authorRobert Varga <robert.varga@pantheon.sk>2016-01-30 18:30:36 +0100
committerRobert Varga <nite@hq.sk>2016-01-30 22:20:30 +0100
commit81d99acf457ddc199ffbb3355278906cf0585fbc (patch)
tree7da470cc82ba34b1f838dd2c19fe138b8c91601b /vpp-japi/japi/vppjni.h
parent3142430cea57f810d136bb3249ededb2a4f2f18b (diff)
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>
Diffstat (limited to 'vpp-japi/japi/vppjni.h')
-rw-r--r--vpp-japi/japi/vppjni.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/vpp-japi/japi/vppjni.h b/vpp-japi/japi/vppjni.h
index 2fe2893b374..847bbe9242e 100644
--- a/vpp-japi/japi/vppjni.h
+++ b/vpp-japi/japi/vppjni.h
@@ -150,8 +150,6 @@ typedef struct {
/* attachment of rx thread to java thread */
JNIEnv *jenv;
JavaVM *jvm;
- jclass jcls;
- jmethodID jmtdIfDetails; // interfaceDetails method
uword *callback_hash; // map context_id => jobject
uword *ping_hash; // map ping context_id => msg type called