Defining inherited classes in JNI
I have to use JNI in order to inherit a concrete class from an abstract one (java.util.TimerTask) and, then, instantiate it.
I have to re-define the abstract method "run" of "TimerTask". In Java it's a trivial problem but I have to do it in C++!
I hope I explained my problem. How do I work this?
# 1
Well, it's not entirely clear. My assumption is that you want to derive a concrete class from an abstract class, and you want the concrete class to implemenet "run()").
1. Define your concrete class (in java). Give it a run method, but deine the run method as native.
2. Run jnih and generate a .h file (C header file) for the native method.
3. Write a library (dll on Windows) that implements the subroutine as declared in the .h file.