6

I want a list of all the ways two JVMs can communicate. The JVMs can be local or remote.

The obvious ones are

  • Socket Communication
  • RMI
  • Shared Memory(File/Database)

Note: I am not interested in comparing these as the way we choose depends on the need. I am curious to know what all ways actually exist.

Sundeep
  • 1,536
  • 5
  • 23
  • 35
  • A fairly generic question. 2 JVMs can interact using "any" existing protocol, e.g. 2 JVMs can interact based on JSON. Maybe should should further describe what you mean by _communicate_? – home Jul 20 '11 at 15:18
  • The reality is that anything that can be manipulated in one process and read in another is a possible means of IPC. – ptomli Jul 20 '11 at 15:19
  • For a more bizarre example, one could communicate with the other by taking a screenshot of a monitor and processing it! – Jeff Foster Jul 20 '11 at 15:23
  • @home Agree. I feel stupid now, but I'm glad I got to know that this is not the right question to ask. I will read up about IPC more and see how I can do it in Java. By communicate I just meant that I should be able to send a signal/message/have the ability to change some state in the other JVM. – Sundeep Jul 20 '11 at 15:24
  • @Jeff To me that falls under 'File I/O' as we use a file for the communication. – Sundeep Jul 20 '11 at 15:26
  • @Sundeep no, you use an embedded javacard with probes into a pigeon's visual cortex to process the screenshot embroidered on a silk scarf by a java controlled robot. – Pete Kirkham Jul 20 '11 at 15:47
  • Don't forget [IPoAC](http://en.wikipedia.org/wiki/IP_over_Avian_Carriers). I heard a test was done, and it proved to offer a higher data rate than one of the major ISPs of South Africa. – Andrew Thompson Jul 20 '11 at 16:37
  • @Pete Now that is **two** techniques employing the power of pigeons. Those birds are running hot, tonight. – Andrew Thompson Jul 20 '11 at 16:42
  • @Pete That's Funny. There's no second JVM by way. – Sundeep Jul 21 '11 at 14:09

1 Answers1

4

See inter-process communication.

Jeff Foster
  • 43,770
  • 11
  • 86
  • 103