1 Reply Latest reply on Jun 24, 2009 6:46 PM by paulo fabiano

    Dashboard with Flex, BlazeDS, Servlet and Thread. HELP PLEASE!

    paulo fabiano

      Hi everybody,

       

      I'm building an java application where I have a thread that check some informations every second. When I have some changes in that informations, I do somethings and send a message to my destination (I'm using BlazeDS to JMS).

       

      My flex application is my consumer. When I receive a message, I update the data on the dashboard.

       

      My thread is started by a Servlet. My problem is that, when I start the dashboard, the first data must be requested by the dashboard. I don't know if is possible to access properties of a running thread with flex, so, I decided startup the thread by a servlet, where I have a public Collection property where I put my database's records.

       

      In my servlet doGet method, I can't return the property because of the void method's type. 

      Ps: My servlet is started on servlet's init method.

       

      So, with no better solutions, I decided to manualy output a XML string and request the servlet by the HTTPService.  By the way, it's not working, rss anyway...

       

      Could you guys suggest me any other solution, architecture, etc ?  Actualy, what I'm trying is:

       

       

                              (receive obj's by jms)         (started by servlet)                                   (logical rules)                       (input data)

      Dashboard <--------------------------------------------------- Thread <----------------> DB <----------> java core engine <------------->  Web Interface

             \------------- (first time, request data) ---------------- ^             

                                                                           (by servlet)

       

       

      Is it possible to access any running thread data with flex?

      Is it possible to return an object from a servlet directly to flex?

       

       

      At,

       

      Paulo Fabiano Langer