VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts) 1 "helpful" answer available (6 pts)
3 Replies Last post: Oct 13, 2009 3:02 PM by Cédric  

Relationship of plugins and classloaders posted: Oct 12, 2009 12:05 PM

Click to view BlueDevilDan's profile Novice 18 posts since
Jun 17, 2009

I was trying to create plugins that are interrelated. Meaning I have distinct Object groupings that I want to expose as plugins to the orchestrator. Internally however, there is java code that is common between them. It appears that each plugin is managed with its own classloader internally, which means that these common classes may be constructed via different class loaders, which creates problems when objects intermingle.

It would be really cool to have plugins that can depend on other plugins in such a manner as they would be managed via hierarchical class loaders. In this way I could have a core Plugin A that could be extended via a Plugin B. I could then in the Java script create objects from Plugin B and hand them to objects of Plugin A to further manipulate. Then internally, since Plugin B depends on plugin A, Plugin B's classloader would be a child of plugin A's classloader, making it possible for the Plugin A classes to see all instances of Plugin B objects as created within the context of its Plugin A's class loader.

The particular problem I have is that Plugin A works via annotations and the classes in Plugin B are annotated by classes defined in Plugin A. Unless these annotation instances are loaded via the same classloader, they are not seen as equivalent.

Is there some aspect of the plugin mechanism that I have missed that would support this? Is there any plan that would support this in the future?

Re: Relationship of plugins and classloaders

1. Oct 12, 2009 1:21 PM in response to: BlueDevilDan
Click to view Cédric's profile Hot Shot 75 posts since
Jun 27, 2008
Their is no official way to be able to "share" class loader between plug-ins. I think there is no way at all... (but have to check)

Re: Relationship of plugins and classloaders

3. Oct 13, 2009 3:02 PM in response to: BlueDevilDan
Click to view Cédric's profile Hot Shot 75 posts since
Jun 27, 2008
If you want to send me an email, it should be great.

For example, being able to access the VI plugin from any other plugins, I think...

Developer Social Media

Communities