Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Why can't a plug-in see a fragment's additions?
Why can't a plug-in see a fragment's additions? [message #579353] Tue, 09 September 2008 18:47
Eclipse UserFriend
Originally posted by: wbeckwith.gmail.com

Background Info.

I'm in the process of porting a swing app to the eclipse platform and I
have hit a situation where deadlock happens between a set of plug-ins.
Basically there is a plug-in foo that depends on a plugin bar. However
plugin bar has buddy classloading enables because it needs to
dynamically load classes from plugin foo at runtime (i.e. log4j needing
to load a custom appender). The deadlock happens when 1 thread loads a
class A from the foo plug-in (thus locking the foo's bundle classloader)
and in the process also needs to load class B from the bar plug-in (thus
trying to lock it's classloader). However, in another thread, class R
is being loaded from the bar plug-in (thus locking the bar's bundle
classloader) and in the process also needs to load class R from the foo
plug-in (thus trying to lock it's classloader). Classic deadlock.

Ideally there should be no cycles in the classpath, but buddy
classloading is required to make the classes available for the log4j
case. So I see only 2 ways that this can be resolved, 1.) one is to
collapse the entire project down into a single plug-in, so that there is
only 1 bundle classloader, or 2.) I thought I could turn the bar plug-in
into a fragment and then there would again be only 1 classloader.

However, after doing this the foo plug-in does not see the classes
contributed by the bar fragment leading to compile errors in the IDE and
pde build. Only if I create a new zoo plug-in as a dependency for the
foo plug-in and change the bar's fragment's host plug-in to be the zoo
plug-in can the foo plug-in see the classes exported by the bar
fragment. But this introduces another classloader, which is the very
thing I'm trying to remove.

So in essence why doesn't a plug-in see the merged classes/resources
from it's contributing fragments?

Wb
Previous Topic:How to open programmatically my Preference Page?
Next Topic:Problem with p2 and version qualifiers
Goto Forum:
  


Current Time: Thu Apr 25 13:22:17 GMT 2024

Powered by FUDForum. Page generated in 0.02406 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top