While I agree that this would be very nice, I don't see how we could achieve this without changing the way the dynamic class loading is provided.
Carsten 2014/1/7 Chetan Mehrotra <[email protected]> > Hi, > > Sling provides support for DynamicClassLoaderManager which is used by > various bundle which need to instantiate classes from string class > names in OSGi env. As per current logic the DynamicClassLoaderManager > service factory would be unregistered and re registered if any of the > bundle state changes from which classes were loaded by *any* of the > DynamicClassLoaders > > This causes quite a bit of churn in re deployments of bundles whose > classes are used within scripts. As services in all bundles which make > use of DynamicClassLoaderManager get reinitialized as typically > services haves a static reference to DynamicClassLoaderManager. > > Such a churn can be avoided if we only unregister the service used by > those bundles whose DynamicClassloaders have used classes from bundle > whose state got changed. Can such an approach be used or we need to > unbind DynamicClassLoaderManager for all users on every change? > > Chetan Mehrotra > [1] > http://sling.apache.org/apidocs/sling6/org/apache/sling/commons/classloader/DynamicClassLoaderManager.html > [2] > https://github.com/apache/sling/blob/trunk/bundles/commons/classloader/src/main/java/org/apache/sling/commons/classloader/impl/Activator.java#L110-L127 > -- Carsten Ziegeler [email protected]
