The approach that Java interprocess communication can take:
Socket/rmi/webservice/webserver, all of which enable direct data exchange
Database/file, these allow for indirect data exchange
See if your business requires real-time, and if not, it's easier to Exchange databases
In addition to sockets, the preferred IPC can either use RMI or CORBA.
In fact, the CORBA implementation of Java is also achieved through RMI, and RMI in the final analysis by the socket to achieve.
So the most basic means of communication between Java processes is that the socket is not too.
Inter-thread communication:
You can directly pass in shared variables to implement
If it's a two-computer communication ... Everything is a socket ... What Mina Ah, MQ Ah, HTTP ah, can achieve AH
If it is local, the method is more, file, database, memory ...
You can use the Actor model Java or Scala implementation, now Akka and Jactor can try, but it is recommended that you use Akka, Java version of the API, the use is very simple, performance is also possible.
The traditional way of interprocess communication is as follows: (1) pipe (2) named pipe (FIFO) (3) semaphore (Semphore) (4) message Queue (MessageQueue) (5) shared memory (sharedmemory) < EM id= "__mcedel" > (6) Socket
How Java supports inter-process communication. We understand the Java process as a JVM process. It is clear that most of these traditional technologies cannot be exploited by our applications (these interprocess communication is implemented by system calls). But there are many ways in which Java can communicate between processes.
In addition to the socket mentioned above, of course the preferred IPC can use RMI, or CORBA can also. In addition, Java NiO's mappedbytebuffer can also be used to implement interprocess communication (shared memory) through a memory-mapped file.
Java Inter-process communication