tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anil K. Vijendran" <...@eng.sun.com>
Subject Re: a few comments
Date Tue, 19 Oct 1999 19:18:07 GMT
Jan-Henrik Haukeland wrote:

> "Craig R. McClanahan" <cmcclanahan@mytownnet.com> writes:
>
> > > > 2) It would have been great if we could design the Servlet class
> > > > loader like we have in JSERV1_1DEV so that we can have pluggable
> > > > ClassLoaders. That way we can (e.g.) have a Java2 classloader that can
> > > > give servlets loaded a code source, so it's possible to control
> > > > security permissions for servlets loaded via a Policy file. This is
> > > > important in a multi hosting servlet environment, for example for ISPs
> > > > that are hosting servlets.
> > >
> > > Yep. Once again, this would be great to see.
> > >
> >
> > Haven't thought about this one at all yet, but agree that it would be great.
>
> If you find it interesting, I could try to port the Loader interface
> and SecureLoader to Tomcat. In addition most of the methods in the
> current ServletLoader should probably be moved to a LoaderUtil class
> so that different class loaders can re-use code and use a LoaderUtil
> class for delegation.
>
> From what I have seen of the code after a quick browse, this will
> include work to create a Loader interface similar to what we have in
> JSERV1_1DEV and have org.apache.tomcat.core.ServletLoader implement
> this and make org.apache.tomcat.core.Container use a Loader type
> instead. This should be transparent to the rest of the codebase.

An alternative is to have the ability to set a delegate on ServletLoader. This
delegate is a ClassLoader. This is how the J2EE implementation does it.

> BTW, It doesn't look like Servlets are reloaded if the originating
> source file (class/jar file) is changed, did I miss something and if
> not, is this intentionally?

I believe this is not implemented yet. I would imagine the only way this can be
done is by creating a new classloader. Unfortunately, we didn't have an
opportunity to do that in the past because of issues involving classes in one
loader trying to access classes in another. This hasn't been a hot button in the
past because people can always create a new context and put the new servlet there.
Agreed, this is not great.

> Another thing, it would have been greate if we could use something
> similar to Craig's LifeCycle interface (from JSERV1_1DEV), such a
> design makes it easier to manage pluggable components like a Loader
> and Logger (and so on).

This sounds interesting. Can you explain more? Thanks.

--
Peace, Anil +<:-)



Mime
View raw message