Advice for invoking external binary from a servlet

K

Kira Yamato

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.

I am much appreciated for any insights. Thanks.
 
N

Nigel Wade

Kira said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top