kri shan wrote:How to pass values from one JVM to another ?
Your basic options are network, file, and shared memory. Java doesn't include a shared memory feature in the core API, so that option is out, unless you want to use JNI or JNA to interface with native code.
Or you could connect the System.out of one JVM directly to the System.in of the other.
Ivan Jozsef Balazs wrote:Serialization is a way to turn Java objects into a data stream or the other way around. It can help package the data to be exchanged.
But the conduit, the channel to exchange them is another question. You write (and read) ser'ed data to (and from) memory, a file, a socket, a pipe.
@ Krishan : Sorry man, I gave an irrelevant answer. Take it back.
@ Ivan : Can you perhaps provide a link where I can understand these concepts of pipes / sockets / shared memory? I have no idea what they are or how these can be programmed. Basic entry level tutorial to networking concepts maybe would be of much help.
Ivan Jozsef Balazs
Joined: May 22, 2012
You should decide first whether files, (named or unnamed) pipes, sockets (or to an give exotic example shared memory) are best suited for your application.
These are general (non-Java) notions. I have not searched tutorials etc. on them recently, but Google (or your favorite search engine) is your friend.
I am sure an introductory level understanding on sockets can be acquired form a decent Java networking tutorial.
Java Custom Networking