[Advanced-java] class loaders and appservers and unloading apps

Rob Helmer robert at roberthelmer.com
Mon Sep 22 16:56:35 2003


Well, the App server is also responsible for the classloader, so it
can forcibly unload classes as it wishes. Servlets/EJBs aren't really
independant applications, they depend too much on the App server to
control their life cycle.

It's best if the "destroy()" method is run of course, because you
want external resources like database handles to be closed. 

On Mon, Sep 22, 2003 at 07:48:09AM -0500, Hanasaki JiJi wrote:
> We are thinking alike; however, does that mean that poorly implemented 
> jsp/servlets/ejb's cannot be removed/shutdown?  the appserves seem to do 
> a darn good job all the time.  The installed apps are treated more like 
> a OS process.
> 
> Rob Helmer wrote:
> >On Sun, Sep 21, 2003 at 02:44:53PM -0500, Hanasaki JiJi wrote:
> >
> >>How is it that an appserver tomcat/bea/jboss.... can kill an app and 
> >>unload it even if it has threads running to object instances that are 
> >>inuse and not ready for garbage collection?
> >>-- 
> >
> >
> >
> >I believe it is because you run Servlets and EJBs inside App servers, which
> >must follow a stricter API, and not actual Java applications (e.g. a 
> >command line utility with just a "main" method).
> >
> >Servlets must have an init() method, destroy() method and so on.
> >
> >JSPs are basically Servlets when it comes down to it, and EJBs have
> >a similar API wherein they are invoked and destroyed by the App server.
> >
> >The App server also handles garbage collection for all running
> >Servlets/EJBs; for instance, there is just one garbage collector per
> >App server instance, rather than per-servlet/per-EJB.
> >It also handles thread allocation.
> >_______________________________________________
> >Advanced-java mailing list
> >Advanced-java@lists.xcf.berkeley.edu
> >http://lists.xcf.berkeley.edu/mailman/listinfo/advanced-java
> 
> -- 
> =================================================================
> = Management is doing things right; leadership is doing the     =
> =       right things.    - Peter Drucker                        =
> =_______________________________________________________________=
> =     http://www.sun.com/service/sunps/jdc/javacenter.pdf       =
> =  www.sun.com | www.javasoft.com | http://www.sun.com/sunone   =
> =================================================================
> 
>