Re: C->JNI->fast webpage updates?
Joe wrote:
Why use C/JNI at all, why not use JSP/Servlets?
Maybe something I wrote didn't come through correctly. The data is
coming from a lib in C, which received data off the network. I then need
to write bindings for that to get into my web server.
How would you get it from a C lib into web pages if you didn't use JNI?
I'm serious about the static web page thing. Write a C program to put
data in HTML, write it to disk. Users can fetch it there.
You really haven't said why you need any kind of dynamic connection.
Does the data arrive very fast? Is it different for each user? (You
just said "no" to that one, actually.) How long will old data be stored?
I can think of lots of better things than a straight C lib to Java
connection. One would be to save the data in a database, then fetch it
from there. JSP would be ideal for serving data in this case.
But what you are proposing has lots of funny corners that may not make
for a clean solution. Is the C lib multi-threaded, for example? There
could be a nasty surprise for you if the C lib not very carefully
written for access by multiple threads. Saving the data elsewhere (in
HTML, for example, or to a database) breaks this dependency (and that's
a good thing).