1 Reply Latest reply on Mar 8, 2011 3:15 PM by mp911de

    rich:progressBar in RF4

    marsim86

      I have looked how rich:progressBar works, and I get showcase works fine (http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=progressBar&skin=blueSky) but I cannot execute other process in the same time and I need do it, I will explain:

       

      I have got a process that spend much time, so I would like while it is been executed, the progress bar is shown.  I would like call in the same time, the startProcess (as in code example) and other process that execute my process that spend more time.

       

      I don't know if it is possible, if not I would like to know how I can do it.

       

      Thanks in advance,

       

      Marcos

        • 1. rich:progressBar in RF4
          mp911de

          Hi Marcos,

          a long-running background-process would be a task that would be executed in a separate thread. Threads are in J2EE bad karma, so you could:

           

          1. Use a Message Queue to trigger a Message-Driven Bean (write your state to a database or keep it somewhere in memory)

          2. Use a Timer (via EJB Timerservice) to launch a background process

           

          In startProcess you would start the background job and check, whether it lives.

           

          Example for Timer see http://www.java2s.com/Code/Java/EJB3/EJBTutorialfromJBosstimer.htm

           

          Best regards,

          Mark