Hi All,
I am implementing a piece of Java software that will hopefully allow for C libraries as plugins. In order to call these future functions I need to somehow create a native function in Java from which I can call the code that doesn't exist yet.
The method signature will be static but the method and class names may change.
I am fairly new to C, ok very new to C, but I was wondering if there was a way to check the loaded libraries or available functions.
The way I would hope it to work would be as follows;
In my Java class I would have a function;
public static native void thirdParty(String class, String method, int[] data, int[] params);
Which would call a function in my C library;
JNIEXPORT void JNICALL Java_com_ex_app_Native_thirdParty(JNIEnv *, jclass, jstring, jstring, jintArray, jintArray);
From which I could take the class and method name and call them if they exist and throw an exception if not.
I guess what I'm looking for is some kind of Java style reflection but in C or failing that C++.
Any better ideas to achieve this goal would also be more than welcome!
Kind regards,
Gavin