For Felix OSGi, loading bundles automatically using a JAR in the Load directory is a snap; and getting a bundle stopped and uninstalled from Felix works well. But, what if you want to delete the file from the Load directory while the Tomcat / Java container is still running? I'd like to remove the JAR file when a user takes an action in my app to uninstall a plugin so that if they issue a restart to the Felix Framework (also a supported UI action), that it doesn't re-discover the JAR and reload the plugin.
When I try to do this, though the file is locked by some other process. Anyone know what might be locking it and how to shut it down so that I can get a lock on the JAR to move / delete it?
NOTE: I have tried shutting down the Felix Framework using
m_fwk.stop();
m_fwk.waitForStop( 0 );
Where m_fwk is a started instance of org.osgi.framework.launch.Framework