Pushing from an external program

Hi,

I’m currently evaluating VAADIN 7 for a new Project. One of the requirements is for a standalone application to communicate with the VAADIN server. The standalone app fires events which have to update VAADIN Clients. ICEPush works with VAADIN Server, but how can ICEPush be invoked from an external program? Via a Servlet, Listener, ServerSocket? Can this even be done?

I prefer using ICEPush instead of the Refresher Add On as a workaround, since it would not constantly poll the standalone application, but vice-versa only gets triggered when data is available to process.

Thank-you

Depends on what kind of software the external one is. If it is an Java software in the same JVM, then there is standard ways for communicating between softwares. If it is something else, you could build an url within your servlet (Vaadin app) that takes in events and data trough GET parameters. For example if your app is at www.myhost.com/app, then you could have an url like www.myhost.com/coomunicate?message=hello, which the app parses and pushes to the user.

There is certainly other ways to do it as well.


Remote Method Invocation
is also an option.

Thank you for the quick response. Yes the standalone client is a Java application and I really like your idea to use GET parameters as it does not require any other services to be programmed or deployed. On the client side I can use Apache Httpclient for the communication.

I suppose POST parameter would work as well with VAADIN?

My thought was that the page taking in the request doesn’t have to be in any way a Vaadin application, it just have to live within the same servlet to have easy access to the Vaadin application. It could be a plain html page or a jsp page or whatever. Map it in web.xml and you are good to go. I used GET as an example as it is the most easy to understand when the info is right there in the url, but any other way would do.

I can’t give an exact list of do this and do that, as don’t know the application that you are building, so you have to decide yourself which method to process is the one that makes the most sense.

That’s great to know that a ‘regular’ servlet in the same container as my VAADIN application can access it. I’m new to VAADIN, so my next question is how this ‘regular’ servlet would access the application context of a VAADIN app? I found the following:


WebApplicationContext.getApplicationContext(HttpSession session).getApplications()

Specifically how to invoke the ICEPush.push() which runs in a thread to let VAADIN update its clients from an non VAADIN context?