On Fri, 2008-10-17 at 11:06 +0200, Mladen Turk wrote:
Hi,
Have some weired idea and would like to hear if someone
already faced something similar.
It's not directly related neither to AS nor Tomcat
but both of them have the conceptually similar application
classloaders where you put some component .jar in
some (usually) lib/ folder and it gets loaded and
hopefully unloaded on undeployment.
Now, the handy feature I need would be similar to Operating
System "Move on reboot" or "Reboot required" functionality.
In essence, like with some native installations there are two
major issues. Depending on what you are installing it might
just go on, or it might require OS reboot. Installation might
just be done for current user or it might require elevated
security.
So the first thing, if for example, my .war or .ear needs to
install something to core AS or to the catalina.home/ext
is the option to tell the deployer to unpack something in
a different location, and mark the "OS" (in this case my
container) to reboot. This requires delegating this
to the parent classloader or even to the
sun.misc.Launcher$ExtClassLoader
The second thing is undeployment or uninstall where some
part of what was installed can be physically deleted only on
reboot (probably either by some cleanup task on shutdown or
by some cleanup on startup)
This probably breaks a whole bunch of specs and has potential
security implications, but given "admin" security credentials
it can be done without impacting "user" security.
Dunno how Adrian did it for MC, but I suppose it just
sweeps trough some given .jar list on deployment and loads
those classes.
You can do this already in JBoss5 for those classes that are hot
deployed, provided you use the OSGi classloading rules.
The classloading depenencies will automatically cause
the importing applications to be redeployed when a
dependent jar changes.
But these classloading dependencies are not currently
specified by our services (see an earlier post of mine
on this list).
If the classes are not hotdeployed, e.g.
the jars in JBOSS_HOME/lib then you have to reboot the whole
server.
--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx