how to execute java program remotely
Could anybody tell me which technology is best suited for the following problem.
Here is the scenario :
I have a billing system (in form of a jar), IT people execute it on ad-hoc basis through a shell script from that same machine. Everything was fine until they came up with a new requirement which is that they want to execute it from a web-application, so that anybody who is authorize can execute ad-hoc billing from his own computer within a network or maybe from the outside.
Now there are two major technologies that came into my mind JMX and RMI. I just want somebody to tell me which is best suited for this kind of scenario. In addition to the above requirement I might need to ensure that there is only one instance of the billing system running at a given time. First cause it takes hours to complete billing secondly, I did not keep thread safety in my mind while designing the system.
NOTE : putting jar in a WAR and exposing through servlet or jsp is not an option. In other words only j2se is the option not app/web server.
Please suggest if you can come up with any other solution except (JMX or RMI).
Thanks in advance.