Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » CCL and the Swing event queue
CCL and the Swing event queue [message #90641] Thu, 14 June 2007 08:39 Go to next message
Martin Lippert is currently offline Martin LippertFriend
Messages: 124
Registered: July 2009
Senior Member
Hi,

one more classloading question arises while I am trying to embed my
Equinox-based Swing app into an existing Swing app.

The Swing event queue thread is created by the existing
(non-Equinox-based) app. This means it has the app class loader as CCL.
Now my Equinox-based app is started and creates some Swing stuff
(everything is fine until now). Since I am not allowed to change the CCL
of the Swing event queue all my callbacks I get later from my Swing
widgets has the app class loader as CCL, not the ContextFinder (which I
need inside by bundles).

I could wrap all callbacks with setting/resetting the CCL (this is what
the server-side stuff does for http requests that are dispatched to some
code inside a bundle). In my Swing setting this would mean to insert those
wrapping stuff at every single listener callback I registered at some
Swing widget. Sounds not much fun to do... Does anybody have a better
idea? Any kind of nicer solution for this?

I already thought of implementing a specialized event queue that does the
CCL switching for me...

What do you think?

Thanks again!!!

Cheers,
-Martin
Re: CCL and the Swing event queue [message #90681 is a reply to message #90641] Thu, 14 June 2007 15:22 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
Hi Martin,

Unfortunately I don't have a better idea for handling this (but I have
not thought very long about it ;-)

That being said, I have to ask why you depend on the ContextFinder CCL
so much from your Swing widget classes in your bundles? Typically the
ContextFinder is used to "convert" context class loader usage from
bundles into simple Class.forName calls which just turn around and use
the classloader of the calling bundle. Can you avoid using the CCL from
your bundle code. I suspect the answer is no because you must be using
some legacy code that cannot be changed easily. But I had to ask ;-)

Tom.
Re: CCL and the Swing event queue [message #90696 is a reply to message #90681] Thu, 14 June 2007 20:13 Go to previous message
Martin Lippert is currently offline Martin LippertFriend
Messages: 124
Registered: July 2009
Senior Member
Hi Tom,

As you guessed correctly: I am not using the CCL in my own code at all.
Unfortunately the CCL is used by some libaries (we have to use) and the
JDK itself (see previous question regarding the XML parser stuff)... :-(

Our own bundle stuff is (of course) designed nicely using the standard
OSGi mechanisms (import, export, require) and thats it... ;-)

The connection to Swing comes from the fact that the app calls some of
these CCL-addicted libs as a reaction to some user action (button click
or whatever).

Seems to be a hard problem...

Cheers,
-Martin



> Unfortunately I don't have a better idea for handling this (but I have
> not thought very long about it ;-)
>
> That being said, I have to ask why you depend on the ContextFinder CCL
> so much from your Swing widget classes in your bundles? Typically the
> ContextFinder is used to "convert" context class loader usage from
> bundles into simple Class.forName calls which just turn around and use
> the classloader of the calling bundle. Can you avoid using the CCL from
> your bundle code. I suspect the answer is no because you must be using
> some legacy code that cannot be changed easily. But I had to ask ;-)
Previous Topic:Testing bundles from the outside
Next Topic:some more classloader challanges
Goto Forum:
  


Current Time: Sat Apr 20 00:35:44 GMT 2024

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

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

Back to the top