Question

I have 3 web applications. They all have a common set of functionality which is an IO operation:- write to a text file and access written data. I am going to separate this function (file writing) as a single application which accepts requests from all application and write to text files and returns when they are required.

Actually this is something like a session management between browser and a server. Each user connect to the server is identical and each user is treated separately. The same is required here between 3 applications and this separated application and connected though HTTP connection .

Some set of instances of classes of this seperated application should be identical, seperated for each calling applications.

This separated application is supposed to be deployed as a war file. Please guide me how I can achieve this ?
Will I have to use web services ? or something like REST ful services? Any sample sources projects/ codes, links are highly appreciated.

Was it helpful?

Solution

Web Service is an option, specially because it's incredibly easy to implement using JavaEE annotations.

One thing you must consider in this case is to ensure proper authentication, so you can be sure your services are being properly exposed only to your desired clients.

Other option is RMI.

I am used to work with Eclipse and TomEE, just in case you need any example, although, even TomEE site has some examples itself - http://tomee.apache.org/examples-trunk/simple-webservice/README.html

Just to be sure, is the communication overhead necessary or could you just wrap your I/O logic into a JAR? This way it would be way easier :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top