Java – GWT as part of a non web application

We have a java server application that runs some batch jobs Its core function is not as a web application, and there is no reason to do so But we want to add an option to check the functionality of the application on the web page We think this can be done well through the Google Web toolkit

In any previous experience with GWT, we have deployed it on Tomcat But in this case, it seems a little over - right The web part is more like the function that the application actually performs

I'm thinking about a solution to integrate the web server into a jar file - maybe jetty? In this way, the complete Java application can be deployed together with the web / GWT part into a single jar file

There may be performance, but there are few users on the web Is there any other reason not to do so?

Also, can you provide some suggestions on how to configure eclipse / ant / jetty / GWT for this?

Solution

We have had similar experience in previous projects There is an eclipse RCP application with an embedded jetty server (which starts programmatically when the application starts) GWT applications are usually deployed in jetty There is also an OSGi service as a controller to provide communication between the GWT server and other parts of the application GWT server is a common RCP server, which is described in most examples It has a reference to the controller In addition, it is an event listener that supports robot communication

I think the main problem we face is synchronization Because there are a large number of messages between eclipse RCP applications, GWT and GWT have asynchronous communication between the client part and its server part. Therefore, some mechanisms must be created to synchronize these messages Otherwise, there is no performance problem (except IE 6. S: D which must be supported)

I hope this will help

UPD: as far as I remember, the controller is registered as an OSGi service just to be able to communicate with other services in the eclipse RCP part In order to communicate with GWT, the controller is implementing a special interface known to the GWT server (the controller is registered as the implementer through instantiation, and the server is registered in the controller as imessagelistener) This interface is located in a separate project and can also be built into In the war file The project also contains multiple events to support backward communication from the controller to the GWT server through the imessagelistener interface

Sorry, it's a little confusing Maybe I should draw a chart

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>