views:

24

answers:

3

On one box there is a running java server I create.

Another app allows me to call shell scripts to perform authentication function.

I'm looking for an efficient way to talk between the shell script and the java server app.

Obvious is launching another java app and using RMI, but this is not scalable to large numbers of calls.

Is there a good way to do this with pipes or sockets that doesn't require large initialization overhead?

A: 

Not quite enough information to tell if you are really going about it correctly. However, java EE has a message passing API to make communication between java processes easier.

Java Messaging Service

jdc0589
+1  A: 
  1. you could use named pipes on linux/unix for example.
  2. you could install redis and communicate via redis blocking list using jedis also on linux.
  3. or like you point out you could use/write sockets.
Alfred
+1  A: 

If the shell you refer to is bash, you can redirect to the special tcp device:

echo "Wake Up, Java!" > /dev/tcp/localhost/[portnum]
Simon