Opened 15 years ago
Last modified 11 years ago
#6396 reopened enhancement
[Experimental PATCH] Allow plugins to be reloaded without restart — at Initial Version
| Reported by: | olejorgenb | Owned by: | olejorgenb |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core | Version: | latest |
| Keywords: | plugin | Cc: |
Description
I have a tendency to test my code very (or maybe too ;) often so I'm starting to get pretty sick of watching the JOSM load screen by now.
Decided to scratch my itch, and here is the result.
The patch introduces a new method in Plugin called preReloadCleanup. All loaded/active plugins implementing this will be reloaded when ReloadPluginsAction is performed. (They don't have to use Plugin as a baseclass)
It's not really tested beyond checking that the new classes actually are loaded and used. Would be beneficial if a java guru could take a look and see if my classloader magic is mostly correct.
Known limitations:
- If p1 requires p2 and only p2 is re-loadable, two versions of p2 will be in use. That can't be good. (Not checked, but I'm quite sure this applies)
checkLoadPreconditionsis not run on the plugins before reload. Fair to assuming the conditions are fulfilled as the plugins are already loaded, but it isn't 100% correct.- Doesn't respect the early/late flags. Is that important?
- Probably need more functions in
MapFramesupportingpreReloadCleanup. (onlyremoveMapModeis implemented now)
This feature is mostly for the plugin-developer's benefit, so it doesn't have to be perfect before inclusion, IMHO.


