Hi,
I encourage you to use CORBA as a glue. Code in C++ the server side
(skeleton) and use Java for the client side (stub). JNI is best suited for C
than for C++, you loose C++ OOP capabilities. In process or in the same
computer CORBA applications have a nice performance, transparent IPC and no
firewalling problems.
Good luck,
Mariano
"Martin Maercker" <> escribió en el mensaje
news: om...
> Hi,
>
> I will soon need to reimplement parts of an existing object model in a
> mixture of Java and C++ code. I leafed through "The Java Native
> Interface - Programmer's Guide and Specification" but am still not
> sure whether JNI can do what I need, especially as regards the
> creation and management of C++ objects from Java code (the creation of
> Java objects from C++ code, on the other hand, seems to be standard
> procedure, at least as far as I could tell from the JNI book...).
>
> What I need to happen on the C++ side is:
> - Set up a singleton which starts a native timer thread.
> - Listener objects register with the singleton.
> - At each timer thread callback, a specific method is called in each
> listener.
> - At different times in the course of the app's lifecycle, individual
> listeners need to be unregistered and destroyed and other listeners
> created and registered.
>
> These management tasks are driven by user interaction. Most of the
> app, including the UI, is in Java, so I need to find a way to control
> the C++ class lifecycles and relationships from Java.
>
> Is this kind of setup possible with JNI? If so, could someone give me
> some advice or direct me to reference material on how best to go about
> it? If not, does anyone know an alternative?
>
>
> Any help greatly appreciated,
>
> Martin Maercker
|