0

I'm having an RCP application, when i copy a new plugin (say com.XXX.version) into plugins folder of my RCP product and upon launching the product this newly copied plugin gets loaded by the framework and it replaces the old one (provided the version which i copied is greater than the existing one).

when I'm trying to do the reverse process (i.e.., deleting the newly copied plugin and reverting to previous state) when RCP application is in running state (i.e.., application is in use) I'm running into problems. The issue is that the application locks these higher versioned plugin files due to which I'm unable to clean up (or uninstall) these JAR's.

Any workaround exists for accomplishing this, Suggestions will be greatly appreciated !! I want to revert back the application to previous state.

Ragu
  • 187
  • 1
  • 11

2 Answers2

0

Have you tried to uninstall the plugin in your BundleContext prior to deletion?

Platform.getBundle("yourBundle").uninstall();

For more information on uninstall() see the JavaDoc

alphakermit
  • 111
  • 9
  • Hi Memmerling, Thanks for your response.. I tried uninstall() method but even then the lock is not getting released. It simply changes the the state of the bundle to UNINSTALLED. – Ragu Oct 07 '14 at 06:35
0

I Found an answer for my issue.

My requirement is to clean all the installed plugins and this cant be done during JVM is in running state (i mean during the RCP application is running). So i tried to delete the plugin JAR files upon JVM exit (i.e.., upon during my RCP exit) by using the method java.io.File.deleteOnExit(), which cleans the plugin upon application exit. Upon next re-launch the RCP application will have these plugins revoked and hence therefore reverts its state to previous one.

Ragu
  • 187
  • 1
  • 11