tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Babu Wisor <babuwi...@yahoo.com>
Subject Re: how to do auto update/reload of a class?
Date Wed, 31 Jul 2002 18:15:21 GMT
Hello Craig,
          Thank you, very much for your thought. You
mentioned that, Jasper does this by creating a class
loader for each page, can you please explain little
bit more as to how the system over all works? I mean,
how does the jasper creates invidual class loader for
each page and make it available to other classes
(servlet/another JSP) loaded by other class
loader(Servlet/another Jasper), since classes loaded
by one class loader is not visible to other class
loader. 
    Please, note that i would like to take similar
approach in my current project, where it requires auto
update of classes in the run time.

Note: In the tomcat documentation, I found that these
things work with Servlet Context, but no documents are
available as to what technique has been used there.

Thank you, very much for your time,
Babu


 
--- "Craig R. McClanahan" <craigmcc@apache.org> wrote:
> 
> 
> On Wed, 31 Jul 2002, Babu Wisor wrote:
> 
> > Date: Wed, 31 Jul 2002 10:15:08 -0700 (PDT)
> > From: Babu Wisor <babuwisor@yahoo.com>
> > Reply-To: Tomcat Developers List
> <tomcat-dev@jakarta.apache.org>
> > To: Tomcat Developers List
> <tomcat-dev@jakarta.apache.org>
> > Cc: ian@darwinsys.com
> > Subject: Re: how to do auto update/reload of a
> class?
> >
> > Hi All,
> >       Does anyone have any thoughts as to how to
> auto
> > re-load the classes, which have been loaded into
> JVM
> > using Custom Class loader? I tried writing custom
> > class loader and loaded all the classes, but don't
> > know how to re-load the same class, if it has been
> > modified (re-compiled) without shutting down JVM,
> > similar to JSP engine, where if we put updated JSP
> > file, it picks up the new file.
> >
> 
> Jasper does this by creating a class loader for each
> page, and throwing
> away the class loader when the page is recompiled. 
> The JVM doesn't let
> you do things any other way.
> 
> > Note: I learnt that, we need to recreate new class
> > loader and load all the classes again, but don't
> know
> > exactly how to apply that technique in the system.
> Any
> > help is greatly appreciated.
> >
> 
> My personal advice, after living through (barely :-)
> getting a class
> loader that would reload a webapp to work, is to
> abandon this approach
> unless you are just doing it for fun and learning
> how class loading works.
> You are going to find that the fundamental
> architecture of Java isn't
> really oriented towards incremental replacement of
> classes (although there
> is a little bit better support in 1.4).
> 
> > Thank you,
> > Babu
> 
> Craig
> 
> > --- Ian Darwin <ian@darwinsys.com> wrote:
> > > On July 28, 2002 10:32 pm, you wrote:
> > > >     Does anyone know, how to do auto update of
> > > classes
> > > > into the JVM? I
> > > > tried to write my own custom class loader, and
> > > loaded
> > > > all the classes
> > > > through it, however if I put new updated
> class, it
> > > > won't reload the
> > > > class again. Have anyone tried this before?
> Help
> > > is
> > > > very much
> > > > appreciated.
> > >
> > > This better asked on an advanced-java list; not
> > > tomcat specific.
> > >
> > > For all the cleverness of Java's dynamic loading
> > > mechanism (ClassLoader,
> > > Class.forName, newInstance(), etc.), there is no
> > > published API for unloading or reloading.
> > > They just didn't think of it in time, perhaps.
> > >
> > > What I think Tomcat and others do is basically
> to
> > > manage the class loader for each Context
> > > (which has to be separate from the CL for each
> other
> > > Context for configuration
> > > and security reasons anyway) in such a way that
> you
> > > can delete
> > > it (un-reference it) and assign a new one and
> reload
> > > the classes
> > > for the given Context.
> > >
> > > --
> > > To unsubscribe, e-mail:
> > >
> <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <mailto:tomcat-dev-help@jakarta.apache.org>
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Health - Feel better, live better
> > http://health.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:  
> <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:tomcat-dev-help@jakarta.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-dev-help@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message