Re: Advice for invoking external binary from a servlet
Kira Yamato wrote:
Hello NG. I need an advice on what is the best way to do the following:
I have an UNIX-style binary program that communicates through stdin and
stdout. I like to expose its functionality to the web. Users will
work with this program interactively, so session states must be kept.
Here's an approach I came up with: I want to use java.io.Process to
invoke an instance of the external program. Then store this Process
object as a session object in the servlet.
I like to know what unforeseen issues may be associated with this
approach. For example,
1) Do I have any cleanup issues to worry about? Like orphan process
launched but never terminated even though the session expires.
2) Or any other issues that you can see?
Or perhaps there is another better way to go about this.
Does it have to be done via a web service?
Have you considered setting up a captive ssh account with the executable as the
login binary? That way a user would have direct communication with the
executable over an encrypted link, but without having to encapsulate the whole
process in HTTP.
--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555