Pier,

Pier Fumagalli wrote:
> 
> IMO, it's a waste of time... You shouldn't call setuid from Java, but the
> native code launching the VM should call appropriate methods at appropriate
> moments of the lifecycle... As I said before:
> 
> 1) CreateJavaVM
> 2) call Tomcat->initialize() (bind to ports)
> 3) set uid/euid/gid/egid/groups
> 4) call Tomcat->start() (accept connections)
> 5) wait for signal
> 6) call Tomcat->stop()
> 7) exit process...
> 
> All the code is already in place... Just need to be tied together...

I agree. I got your sample code to work on Mac OS X 10.1 and, just for kicks,
had Java invoke the callback that was registered.

Since you have separated out the port binding into Tomcat->initialize(), you are
also correct that I don't need to call the callback function from Java. I admit
my thinking was still limited to the existing constraints of the
StandardServer.start() method instead of the new bootstrap classes.

Next thing I will do is take a look at the bootstrap classes and test out your 
recommendation.

> RegisterNative _is_ JNI... JNI is developed on two layers, call C from Java
> (maybe using System.loadLibrary()), and that's what everyone knows.
> 
> Call Java from C (a little bit less known, but way more powerful)...
> 
> We need a JVM invocation API, not a Java callback mechanism, IMO...

We used the JVM invocation API when I was working on StarOffice. However, I
never ran into the RegisterNative method. Although we don't need it for the
setuid() calls, I think it might come in handy sometime.

> That's the beauty of JNI, you can do things that you won't even believe they
> exist, like "compiling" (loading) a class when NOT all its methods are
> there... It's the beauty of a Class seen as an Instance of an object (and
> IMO the biggest advantage over things like SmallTalk)... JG thought it out
> good...
> 

I admit that I kept expecting there to be more work to do. But you keep
surprising me with what you have already implemented. Thanks for having the
patience to walk me through this.

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]>

Reply via email to