[rfc][icedtea-web] Fix for PR1251: AppContext has wrong context classloader
Omair Majid
omajid at redhat.com
Thu Jan 17 15:15:51 PST 2013
Hi Adam,
I haven't looked into this in too much detail, but here are some quick
thoughts.
On 01/15/2013 11:53 AM, Adam Domurad wrote:
> This fixes one of the (numerous) issues in ADOMII, and fixes SweetHome3D
> furniture dragging.
Nice! I can imagine that this must have been a pain to track down.
> I'll preface by saying, I'm not particularly fond of the changes in this
> patch, but they have to be done to fix JNLP applications that load
> resources on the Swing thread, like eg SweetHome3D.
>
> The patch adds a flag to JNLPClassLoader that specifies whether it has
> been initialized. The default for getInstance remains the same, it grabs
> an initialized JNLPClassLoader. However an alternate getInstance was
> added to be able to grab JNLPClassLoader that hasn't been fully
> initialized.
So far, this sounds just fine to me. Well, maybe we could avoid
maintaining a record of ClassLoader instances, but that's a whole
another problem.
> 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?
> 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)?
> This exposes an additional bug in JNLP applets. start/init incorrectly
> runs on the Swing thread, and invokeAndWait hangs forever. I'm not sure
> how this wasn't caught, but the JNLP applet reproducer is broken pending
> a separate bug fix.
>
Nice catch!
Thanks,
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