> Say i have a c library that i need to call in a java web service. Do I
> do it the same way in a standalone app? Will that slow down performance
> of the ws itself?
Yes.
The absolute overhead in the JNI invocation should not be that big
but the relative overhead depend on how much is actually done
in Java and C.
Arne
> Say i have a c library that i need to call in a java web service. Do I
> do it the same way in a standalone app? Will that slow down performance
> of the ws itself?
Adding to Arne's reply...
If you are writing JNI code to be run from a classloader-aware application
(such as I imagine most webservice containers are) then you'll have to be a
little careful about which classloader loads the class with the native code. A
class can normally be loaded by several independent classloaders, but not if it
uses JNI since the external library (DLL, .so, whatever) cannot be shared. So
you may have to ensure that the class with the native code is in the shared
part of the overall server, rather than being specific to one application
running in it.
-- chris
tak - 30 Aug 2006 18:07 GMT
> > Say i have a c library that i need to call in a java web service. Do I
> > do it the same way in a standalone app? Will that slow down performance
[quoted text clipped - 12 lines]
>
> -- chris
Thanks to both arne and chris.