powered by Jive Software

Plugin classloader discussion

Over the last few months, I’‘ve discussed this issue with a number of community members (off forum). Although there was a considerable amount of feedback, the issue was never resolved. That’‘s why now I’'m trying to focus the discussion on one spot.

I’'d like to propose an enhancement to the parent/child plugin structure. Right now, a restart of one plugin in a parent/child relationship (where each parent plugin may have multiple children), will cause all plugins in the hierarchy (the parent and all children) to be reloaded.

I’'m proposing an enhancement where the parent plugin and the other children are not forced to reload if one of the child plugins gets reloaded. I would still like all children to be reloaded if the parent plugin gets reloaded.

The current implementation causes child plugins to be loaded by the same classloader as their parent, unlike normal, non-hierarchical plugins. As classloaders can be linked in a similar parent/child relationship as our plugins, I’'m suggesting a ‘‘child’’ classloader for each child plugin. This would give us the added flexibility of being able to reload one particular classloader, instead of the parent classloader (which would cause everything to be reloaded).

As child classloaders delegate upwards, most of the old functionality would be preserved. One difference in the new situation is that the classes loaded by sibling classloaders whould no longer be visible to each-other. If that is a problem those classes could be moved to the parent plugin (which in those situations seem to be a more logical place for them anyway).

I once submitted a patch that incorporated relevant changes. If I’‘m not mistaken, I’'ve initially sent it to Derek (do you still have it?), which I think circulated within the Jive HQ. The discussion that followed died on the issue of existing plugins that may rely on the current functionality. To issue that, some kind of boolean property could be created to toggle between ‘‘old’’ and ‘‘new’’ behavior.

Any ideas or suggestions?

Hi,

was there any further discussion on this topic? Guus, I think your suggestion provides the more natural procedure on reloading or deleting child plugins and could improve interruptions of services which depends on the parent-kind relation. It would be nice to integrate seperate classloaders for child plugins which provides the classpath of parent plugins but not forces parent-reloads.

Best Regards