This discussion is archived
5 Replies Latest reply: Jan 22, 2013 12:34 AM by Narayan RSS

Pass objects to standalone JavaFX 2 application

943372 Newbie
Currently Being Moderated
Hi,

my application is realized as web application with JSF and partly as JavaFX 2 application. Therefore I have to pass some data from the web world to JavaFX. I successfully tested the communication if the JavaFX application is embedded as applet in the web page. Another thought is to start the JavaFX via web start from the web page and write some attributes to a generated jnlp file. But I have to pass the session information and some selection information to the JavaFX application. Is there another possibility, idea except to go throught the backend and poll from the JavaFX application? Another idea is to use JMS on client side for this inter-process communication, but I have no experiences about that. Has anybody an idea or already done something like that?

Regards
Oliver
  • 1. Re: Pass objects to standalone JavaFX 2 application
    Narayan Pro
    Currently Being Moderated
    Hi opfl,

    As per my knowledge , I would have send the tokenid in the attribute of the JNLP Webstart and the app will launch with that tokenid and link with the web by sending it to server and server validates and run it. But make sure that tokenid gets re-validates and expires as well. All things of token record and generating will be done from server and saved in database.

    Thanks
    Narayan
  • 2. Re: Pass objects to standalone JavaFX 2 application
    943372 Newbie
    Currently Being Moderated
    Hi Narayan,

    thanks for your reply. Probably you mean with tokenid the session id. This I could pass via a jnlp property right. But another use case is to update the already opened JavaFX application with an value selected in the web application. Probably ActiveMQ could be a solution by sending the message via JavaScript and receive it in the JavaFX application.
  • 3. Re: Pass objects to standalone JavaFX 2 application
    Narayan Pro
    Currently Being Moderated
    Hi opfl,

    If the app is already working with the old token then I think you need to make that program to have background validation more like async after few duration of execution. So that user server wont need any trouble of their clients. It is good to have communication from Client->Server than Server->Client :)

    Thanks
    Narayan
  • 4. Re: Pass objects to standalone JavaFX 2 application
    943372 Newbie
    Currently Being Moderated
    My problem is before the client-server communication starts. I have to pass some information to the standalone JavaFX application from a web application. These information is needed to load specific data from the backend. On the startup of the application I could use the jnlp properties, but if the user does another selection in the web application and the JavaFX application is already open, I have to provide the selection to the JavaFX app. This inter process communication could be completely on the client side I think. So I have seen that ActiveMQ provides a javascript api to send JMS messages. Probably this could be a solution if it is possible to set up the JMS queue on client without application server. I do not know if this is possible by now.
  • 5. Re: Pass objects to standalone JavaFX 2 application
    Narayan Pro
    Currently Being Moderated
    Yes i think JMS is probably is best way for that. But you can even do on your own from scratch if you want to customize Like opening socket from client in any port for accepting the incoming message from the Server. Just a simple way.

    Simple Algorithm
    1. After successful startup of the program open the socket and port for accepting message either UDP/TCP. Send this info to server
    2. Register the clients "current" ip and their port in database . So that server can send message there by.
    3. If any changes done by client then send the message to the client after validating the existence of the server
    Thanks
    Narayan

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points