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:

  1. 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)
  2. checkLoadPreconditions is 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.
  3. Doesn't respect the early/late flags. Is that important?
  4. Probably need more functions in MapFrame supporting preReloadCleanup. (only removeMapMode is implemented now)

This feature is mostly for the plugin-developer's benefit, so it doesn't have to be perfect before inclusion, IMHO.

Change History (1)

by olejorgenb, 15 years ago

Attachment: reload-plugins-0.1.patch added
Note: See TracTickets for help on using tickets.