[rfc][icedtea-web] Fix for PR1251: AppContext has wrong context classloader
Omair Majid
omajid at redhat.com
Fri Jan 18 08:24:34 PST 2013
On 01/18/2013 09:30 AM, Adam Domurad wrote:
> On 01/17/2013 06:15 PM, Omair Majid wrote:
>>
>>> The problem with initialization:
>>> - To create AppContext we need JNLPClassLoader object constructed
>>> - To construct JNLPClassLoader we must initialize it
>> Sounds perfectly fine so far.
>>
>>> - Initializing JNLPClassLoader implies downloading all resources,
>>> and updating Swing components
>> What swing components do you imagine are being updated here?
>
> Download indicator mainly + dialogues like "do you want to run this
> applet?"
>
Please make the "do you want to run this applet" dialog run in the
system AppContext, just like all other security dailogs.
>>
>>> However, we cannot update swing components before we create our
>>> AppContext, or the result will be a mess (eg unclickable popups).
>>> In essence, it's a bootstrapping problem. So the patch makes it possible
>>> to get a constructed JNLPClassLoader, which is initialized in a separate
>>> step.
>> I am not a fan of the hack in JNLPRuntime.createNewAppContext where you
>> set the system CL as the CCL on the EDT.
>>
>> We always have a thread (the security thread, I think it's called) that
>> is running in the system appcontext that shows security prompts (see the
>> SecurityDialogs class). Maybe you could add another thread (or extend
>> the existing therad) to display icedtea-web UI (like splash screens and
>> so on)?
>
> Hack indeed so any alternatives appreciated. Can you give me some
> pseudo-code of what you're proposing? It would be greatly appreciated.
> I'm not sure what you mean display a UI in a separate thread -- AFAIK
> the only way to do this in a Swing-compatible way is to add components
> which will be drawn in the (current AppContext's) event-dispatch thread.
Here's the rough idea:
- Create new thread icedtea-web-ui. It should have the system's
AppContext
- Instead of drawing a UI, send a command to icedtea-web-ui thread
- icedtea-web-ui will do what the command says: display/update/modify
the ui appropriately.
The net.sourceforge.jnlp.security.SecurityDialogMessageHandler does
pretty much exactly this for security dialogs. Maybe you can extend it.
See net.sourceforge.jnlp.security.SecurityDialogs for how callers make
use of it.
Cheers,
Omair
--
PGP Key: 66484681 (http://pgp.mit.edu/)
Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681
More information about the distro-pkg-dev
mailing list