Background application threads
------------------------------

                 Key: WICKET-2538
                 URL: https://issues.apache.org/jira/browse/WICKET-2538
             Project: Wicket
          Issue Type: Wish
            Reporter: Pedro Santos


I have a wish for to do wicket component creation on background threads.
Why?
I have an project that has an special panel, that create a lot of images to 
present or not (time consuming) , based on visibility rules, implemented on 
image components on it.
That panelWithImages is in an step of an wizard. When the user goes to the 
wizard, I want to start this panel creation, and when the user go to this step, 
the panelWithImages will to be instantiated our almost.
The actual problem: the image components on panel receive one resource 
reference, set it on localizedImageResource, that call one bind method, that 
some moment will call Application.get()
Why can't I separate the time consuming work from the panel construction 
process?
Actually I can do that, with an extra work. Then in the panel construction I 
just wait for the thread that was started when user open the wizard. But is is 
just a wish. If the application object were set to the background thread on 
ThreadLocal, it would be easier.

For example:
WicketThreadForCreateComponentOnBackground{
        public WicketThreadForCreateComponentOnBackground()
        {
                session = Session.get();
                application = Application.get();
        }
        public final void run()
        {
                Application.set(application);
                Session.set(sessaoGestao);
                createComponentsOnBackground();
                Session.unset();
                Application.unset();
        }

        protected abstract void createComponentsOnBackground();
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to