CNI from apache module

Per Bothner per@bothner.com
Mon Feb 18 12:54:00 GMT 2002


Lars Andersen wrote:
> 
> The news section mentions that it is possible to interface an apache 
> module to java thru CNI (I guess?).

Attached is the code I wrote.  This is for Apache 2.0.16.  It goes into
the modules sub-directory.  You configure with -enable-so --enable-gccsp

There are some issues with threading.  I experimented with both
--with-mpm=prefork and --with-mpm-threaded.  You'd like to use use 
'threaded', both for performance and because you want all "servlets"
to share a single JVM.  However, then you may have to kludge various
things.  For example you need to make sure that gc.h is included so
that the GC can be notified of thread changes.  I tried #include <gc.h>
in srclib/apr/pthread.h.

It's been a while since I worked on this, and I don't remember what
worked and what didn't.  I didn't get it far enough to be useful.
Ideally, you'd want a mdoule that can run real servlets, and that's
a lot of work.  If you just to write modules in Java without using
servlets it may not be as much work, and if you start with my code,
at least you'll have something that can grow into a servlet container.

If you succeed in producing something useful, you may need to patch
some of the core (non-module) files, for example to make sure gc.h
is included where it needs to.  Hopefully, Apache will be willing
to accept the patches, if they're clean enough.

If you're willing to spend time on it, I give you my blessing.
It could be cool to run gcj-compiled servlets (even if only a
subset of the servlet spec is implemented) directly on apache.
If you have any questions, feel free to ask.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gccsp.tgz
Type: application/x-gzip
Size: 69433 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20020218/fee281a2/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: httpd.patch
URL: <http://gcc.gnu.org/pipermail/java/attachments/20020218/fee281a2/attachment.ksh>


More information about the Java mailing list