I have a problem with threads in my JSF application, maybe somebody could help me.
After the start I run new thread which is making some background operations. This thread is working in while(true)
-loop but when there is nothing it can do it calls wait()
. It's working in loop because I have to call notify()
after some user actions.
So now what I want to acomplish: I would like the thread to inform the main thread that the part of the job is finished, so I can update some elements in UI. Any ideas?
I would also like to display FacesMessage, but it's imposible to do so from another thread (even using Observer pattern)