Costin, [EMAIL PROTECTED] wrote: > > 1. I think combining the wrappers ( any of them ) with the > platform-specific native code used inside tomcat is _bad_. > One of the good things about tomcat is that it can be started/mebedded > in many different ways. Creating a small jni library is quite trivial - > MacOS may be different, but I'm sure they provide a way and we can > support it ( if we want in-process and unix sockets there we'll > have to do it anyway - that's jni based ). Keep them separated - > it's more flexible.
I have already wrote a quick test on Mac OS X. It works just like all other platforms. The only difference is that you need to link your shared library with "-bundle" and name it libxxxx.jnilib instead of libxxxx.so. After that, System.loadLibrary("xxxx") will load the library. You don't even need to link to any of the JVM's libraries to do this. > > 2. The 'normal' way to do this, used by all unix daemons, by > all other java servers ( including JavaWebServer and any other > containers except tomcat ) is to use a (jni) call to chuid. > It works, it's tested and clean. > I'm sure this can be obfuscated or done using whatever callbacks > mechanism ( opening all the resource in the wrapper, etc) , but doing it > in the natural way is better IMHO. This is why I was pursuing this approach for the last 2 days. I have seen this type of code way back when I was porting the Java Web Server's JNI code to HP-UX, AIX, and DEC Unix a few years back. Also, I believe that Apache follows this same logic path (although it doesn't need JNI to get to the C function, of course). Patrick -- _____________________________________________________________________ Patrick Luby Email: [EMAIL PROTECTED] Sun Microsystems Phone: 408-276-7471 901 San Antonio Road, USCA14-303 Palo Alto, CA 94303-4900 _____________________________________________________________________ -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>