tags:

views:

316

answers:

4

I have a situation where i need to send commands to a running java application, now i am using tcp/ip socket to send commands to the application using a internet explorer context menu item. But as soon as the application starts virus scanners complain that the application started listening, although i am only listening for local connections. I think this may be confusing to the users. I am looking at others ways of communicating without pissing off av scanners?

A: 

A lot of folks use something like JMS in this scenario.

joeslice
A link or at least anexpansion of the acronym would be nice
KitsuneYMG
Java Messaging Service - I don't think anyone is using JMS in a case like this. JMS probably also still uses TCP socket, which is the root cause of his issue.
Chris Kaminski
JMS is appropriate on a server side application. It is rather unweildy for the client side.
Yishai
+3  A: 

For this, you're best off a file based FIFO queue. Or using Java Native Access/Java Native Interface to write to a NamedPipe or Shared Memory. If you go the JNA/JNI route, you could create a Named Event.

But there's probably no way to do what you want, with any amount of efficiency without going the JNA/JNI route.

Chris Kaminski
A: 

Sockets are pretty much the traditional way of doing IPC, but if you really want to avoid them, you might be able to come up with a workaround using the local filesystem. You wouldn't want to use standard file reads/writes, since you would most likely want to effectively implement a queue in the filesystem.

If I were going to implement IPC through the filesystem, I'd probably use SQLite (which can be threadsafe when compiled so) and have one table for each listener. I'd probably use a single-column table to insert the message, and the listener would just pull out the row with the lowest rowid, then delete said row.

But my approach is not at all Java-specific, so there might be better ways to do that using Java (such as @darthcoder's response).

Mark Rushakoff
+2  A: 

You can use Java Management Extentions (JMX) to expose methods in a running process through a simple web interface.

akf