Menu

#6 Dynamically remove model elements as plugins are stopped

Next_Major_Release
open
Other (2)
5
2006-07-08
2006-07-08
Wyrm Tools
No

At some point, Wyrm Tools is going to support
dynamically stopping plugins while the application is
running rather than only stopping them when it is
shutdown. BUG 1519066 documented a problem in which
the d20 core plugin was stopped, but the model still
contained references to d20 model elements, causing
ClassNotFoundExceptions to be thrown. The fix
implemented was simply to close the model when the
d20 core plugin was stopped.

We need to support a more robust method that can
handle arbitrary plugins being stopped at any time.
I can think of two possible designs at this time:

1) Add a new method to IModel that closes any
openable elements which contains elements defined by
the plugin being stopped. Maybe something like:
public void close( ClassLoader cl ); It would have
to iterate through all the registered elements in the
model looking for ones whose ClassLoader matches the
specified one (presumed to be the stopping plugin's
ClassLoader). Thus, every plugin which contributes
classes to the model must call this method in their
stop() method.

2) Have the model implementation listen for plugins
being stopped and do the same thing as in (1). This
has the added benefit of not requiring plugin authors
to worry about cleaning up after themselves. At this
point, I'm not sure if we can intercept a
notification that says a plugin is about to be
stopped rather than receiving the notification after
the fact.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.