Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

how do you call a c library in a web services?

Thread view: 
tak - 29 Aug 2006 23:23 GMT
Hi,

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?

Thansk,
T
Arne Vajhøj - 30 Aug 2006 00:22 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
> 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
Chris Uppal - 30 Aug 2006 09:12 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
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.