Hi all. I hit a problem with the new DefaultClassLoadingPicoContainer. The
culprit code is invoked when parent.createChildContainer() is called:
protected DefaultClassLoadingPicoContainer createChildContainer() {
MutablePicoContainer child = getDelegate().makeChildContainer();
DefaultClassLoadingPicoContainer container = new
DefaultClassLoadingPicoContainer(getComponentClassLoader(), child);
container.changeMonitor(currentMonitor());
return container;
}
public void changeMonitor(ComponentMonitor monitor) {
((ComponentMonitorStrategy) getDelegate()).changeMonitor(monitor);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
If the delegate happens to be a DefaultClassLoadingPicoContainer, then the
result is a class cast exception, which happens a little more often than not
because there's only a few containers that implement ComponentMonitorStrategy,
and AbstractDelegatingPicoContainer is not one of them.
So, do we have MutablePicoContainer implement ComponentMonitorStrategy, or do we
just more defensively program changeMonitor()? Or is there another option?
Thanks,
-Mike
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email