[jboss-user] [JBoss Microcontainer Development] New message: "ShutdownPolicy"

Adrian Brock do-not-reply at jboss.com
Thu Jan 21 08:21:23 EST 2010

User development,

A new message was posted in the thread "ShutdownPolicy":


Author  : Adrian Brock
Profile : http://community.jboss.org/people/adrian@jboss.org

To support the OSGi semantics of not automatically re-resolving classloader dependencies
when you remove a classloader/deployment, I'm introducing a notion of ShutdownPolicy.
This currently has two options:
UNREGISTER - which is the current behaviour
GARBAGE_COLLECTION - let the classloader remain valid after it is unregistered
This can be set in two places.
1) ClassLoaderSystem/Domain - it then applies to all classloaders in that domain that don't explicitly specify it
2) ClassLoadingMetaData/Policy - in the xml it looks like this:
<?xml version="1.0" encoding="UTF-8"?>

<classloader xmlns="urn:jboss:classloader:1.0"

This effectively resolves https://jira.jboss.org/jira/browse/JBOSGI-206, except there's some work to do to implement the
"refreshPackages" behaviour in ClassLoading.
It also means that a Bundle update() can now be implemented as just a redeploy of the deployment (obviously there's a bit of extra
work required in the OSGiBundleManager to remember and restore the deployment to its previous state, e.g. the start/stop options).
NOTE: In the code I refer to the GC shutdown policy as "lazy shutdown", but also "cascading dependencies".
The second part comes from not unresolving dependent classloaders if we are in "lazy shutdown" mode. Since the classloader
is still valid, previous importers can still use it.


To reply to this message visit the message page: http://community.jboss.org/message/521403#521403

More information about the jboss-user mailing list