[RFC][plugin]: Class loading problem.

Deepak Bhole dbhole at redhat.com
Fri Apr 29 11:42:02 PDT 2011


* Deepak Bhole <dbhole at redhat.com> [2011-04-29 14:38]:
> * Denis Lila <dlila at redhat.com> [2011-04-28 09:34]:
> >  
> > -        // create the frame.
> > -        PluginAppletViewer.framePanel(identifier, handle, panel);
> > +        // Framing the panel needs to happen in a thread whose thread group
> > +        // is the same as the threadgroup of the applet thread. If this
> > +        // isn't the case, the awt eventqueue thread's context classloader
> > +        // won't be set to a JNLPClassLoader, and when an applet class needs
> > +        // to be loaded from the awt eventqueue, it won't be found.
> > +        Thread panelInit = new Thread(panel.getFutureTG(), new Runnable() {
> > +            @Override public void run() {
> > +                SunToolkit.createNewAppContext();
> > +                // create the frame.
> > +                PluginAppletViewer.framePanel(identifier, handle, panel);
> > +                panel.init();
> > +                // Start the applet
> > +                initEventQueue(panel);
> > +            }
> > +        }, "NetXPanel initializer");
> >  
> > -        panel.init();
> > -
> > -        // Start the applet
> > -        initEventQueue(panel);
> > +        panelInit.start();
> > +        while(panelInit.isAlive()) {
> > +            try {
> > +                panelInit.join();
> > +            } catch (InterruptedException e) {
> > +            }
> > +        }
> >  
> 
> Initialization is a separate thread should be fine, but what is the
> above while/join trying to achieve? More specifically, why is it a while
> statement and not an if?
> 

Gah. Ignore that. Didn't notice the try/catch.

Okay, yes, assuming you have tested it, this part of the change to PAV is fine.

Cheers,
Deepak

> Cheers,
> Deepak
> 
> >          // Wait for the panel to initialize
> >          PluginAppletViewer.waitForAppletInit(panel);
> 



More information about the distro-pkg-dev mailing list