Support for extension points within extensions
It would be nice if we could get this to work. In theory the concept is not very complicated. An extension may define additional extension points that are then extended by other extensions. In practice we get a lot of problems with initialization and class loading. Problems found so far:
- The extension points are not loaded at startup. The core
Applicationclass will only load extensions points defined by the
net.sf.basedb.corepackage and the web client will only load extension points defined by the
net.sf.basedb.clients.webpackage. To enable the extension points a server admin must go to the "Administrate -> Plugins & Extensions -> Overview" page and re-install the extension. We could of course require other extensions to use those packages as well, but it would be better to fix the issue so that extension points are loaded at startup.
- Updating a modified extension results in a
Action 'net.sf.basedb.opengrid.test.TestJobCompletionHandlerFactory@61a3083f' created by extension 'net.sf.basedb.opengrid.test-job-complete' is not of the expected class 'net.sf.basedb.opengrid.service.JobCompletionHandler' java.lang.ClassCastException: net.sf.basedb.opengrid.test.TestJobCompletionHandlerFactory@61a3083f -> net.sf.basedb.opengrid.service.JobCompletionHandler at net.sf.basedb.util.extensions.ActionIterator.validActions(ActionIterator.java:231) at net.sf.basedb.util.extensions.ActionIterator.hasNext(ActionIterator.java:114) at net.sf.basedb.util.extensions.ExtensionsInvoker.render(ExtensionsInvoker.java:167) ...
I guess that somewhere in BASE there is something that is not thrown out when the new class loader is created for the updated jar file.
- The above class cast problem happened when both the extension point and extension was defined in the same JAR file. I have not tested to created extensions in separate JAR files. I guess that will be a bit more problematic.