I have .so (shared library) written in C++, lets call it functionality.so in which I implement different functions, here is list of some fu
Have you considered using an automatic wrapper generator for this? I have used SWIG a few times now with much success. The reason that I mention it is that it has well developed patterns for dealing with things such as pointers, including void*
and so on.
Wrapper generation can be as easy as passing in the library's header file if the methods you want to wrap are as simple as the ones you list above. Even if you have some methods that are more complex (passing in structs, returning pointers to memory, etc) SWIG allows you to add code to the generated wrappers if needs be.
Another plus point is that SWIG can wrap into a range of languages, not just Java.