Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Accessing information from a continually executing server app with a client

Options
  • 06-04-2009 2:49pm
    #1
    Closed Accounts Posts: 7,794 ✭✭✭


    Hey,

    I'm new to writing client/server applications, but am currently doing a project which requires it.

    Basically, what I want to do is have clients act as observers to an application executing on a server, while also being able to input information to the server and change its execution.

    Essentially, the server would be a state machine, and the clients would be able to access information regarding this state, and to provide input to it which could affect its state.

    The problem I'm having is any tutorial I find relating to client/server apps involves using a server app that is run on access by the client and retrieves some information from a database, as opposed to an app that is continually executing and which information based on the state of the app can be accessed.

    I'm using Flex for the client and Java for the server.

    One way I've thought of doing this is to simply have the server app update an xml file describing the state of the app every time its state changes. I'm not sure how good a solution this is, however.

    Another way I've thought of doing it is if I could somehow have a jsp page as part of a java application, and that its contents would therefore change depending on the state of the app. I've no idea how to do this though, or if its even possible.

    Any ideas/suggestions?

    Thanks


Comments

  • Closed Accounts Posts: 1,150 ✭✭✭Ross


    XML-RPC? (xmlrpc.com appears to be down, hence the wikipedia link)


  • Registered Users Posts: 2,781 ✭✭✭amen


    maybe use a web service to allow the current state of the server to be polled and also to change the the state


  • Registered Users Posts: 197 ✭✭cracker


    Have a look at BlazeDS. I don't know anything about Flex but it appears to be a way to use RMI to connect a Flex client to a java RMI server. If this is the case you could set your java server app up as an RMI server and just get the Flex client to call a method to query the state.
    If this dosn't work then try googling "Flex RMI" and you might find something else that does it.


  • Registered Users Posts: 2,800 ✭✭✭voxpop


    reverse-ajax (http://en.wikipedia.org/wiki/Reverse_Ajax).

    standard solution:

    jsp +ajax + polling

    jsp displays the info

    use ajax to poll the server and check if there is any new update. If there is then request the new info and update the jsp page. Ajax is asynchronous, so you dont need the page to reload or anything.

    More interesting solution
    use Comet (long life http sessions) ->http://en.wikipedia.org/wiki/Comet_(programming)


    btw - dwr is your friend


Advertisement