I have a Java application that is executed from a perl script on Windows. The perl script is called from another application and given XML messages and expects XML responses. The high level architecture (napkin style) is as follows:
--------------- --------------- ------------
- Windows App - XML --> - perl script - STDOUT --> - Java App -
--------------- XML <-- --------------- STDIN <-- ------------
I have control over the perl script and Java application. I would like to keep the Java application running while processing XML commands and building XML responses. I am considering using procrun and setting up the interprocess communication over sockets perhaps. Before I get into this, I was wondering if modifying the Java application to run on a web server like Tomcat would be overkill or appropriate in this situation?
Sounds overkill because you don’t need to (or at least you don’t state any reasons why the java app should be run on such type of server).
Anyway, it should be possible technically and would have some benefits if you need high performance, a distributed architecture, or want to share the java app between some other apps (as if it was a web service).
You should also take into account that your java app will be executed in multiple threads, so any shared data (like singletons or static variables) may need to be adapted to be reentrant. Depending on how you wrote your app, this could take from no effort to a big time.