3

Two Java programs have to communicate with each other, To do that I found two possibilities

  • Using Sockets
  • Using JavaSpaces

After looking into the description, I found out, that JavaSpaces is apparently the better solution. Sadly, I can't get it to run. Ever totourial roots me to another installation process, to other files and so on.... :(

How to install JavaSpaces, where to download them etc?

If someone offers me a better solution for it I'll be thankful to (JavaSpaces seems to be from 2005)

this are the websites I found so far: http://www.jroller.com/matsh/entry/intreagued_by_javaspaces_try_blitz (Installation description, not working...) http://www.jini.org/wiki/Main_Page (Download links are broken) http://www.jarvana.com/jarvana/inspect/com/sun/jini/jini-starterkit/2.1/jini-starterkit-2.1.zip?folder=jini2_1/ (Download of jini starter kit)

Cœur
  • 37,241
  • 25
  • 195
  • 267
Stefan
  • 14,826
  • 17
  • 80
  • 143
  • I don't think you can make such a bold statement "JavaSpaces is the better solution" without actually looking at what sort of communication do you need in between those processes -- the right tool for the right job, right? So can you expand a bit on what sort of inter-process communication do you need? – Liv May 24 '11 at 09:49
  • I need to interchange objects between processes. If I do it with sockets, I'll have to send them between each other over a port, recieve the message, etc.... It definitly looks like more work than using a shared space in the memory where both processes can put objects and notify about updates. (but its only a hypothesis, thats whay I want to try it out!) – Stefan May 24 '11 at 10:09

3 Answers3

3

For one quick start using GigaSpaces, a commercial JavaSpaces product (with a community edition available), see http://www.gigaspaces.com/wiki/display/XAP8/Data+Grid+Quick+Start

Also see http://replay.waybackmachine.org/20070202031207/http://www.theserverside.com/tt/articles/article.tss%3Fl%3DUsingJavaSpaces and http://www.theserverside.com/news/thread.tss?thread_id=42164 and http://www.enigmastation.com/?page_id=425

JavaSpaces is great, IMO (I'm biased, as I work for GigaSpaces... but then again, I work for GigaSpaces because I think the underlying technology is great.) - it's got a very simple API but the transaction model is actually pretty strong, and it's very fast. It's simpler and stronger than JMS, and has a simpler deployment/connection model.

If you're GigaSpaces-averse for some reason ("yikes, someone makes money from this") you can look into Blitz as well.

Joseph Ottinger
  • 4,911
  • 1
  • 22
  • 23
  • thanks, but I'm already pretty deep into Javas "Remote Method Invocation" (RMI). How much would GigaSpaces coast btw. (I couldn't find that after a quick look at the homepage :P) – Stefan May 25 '11 at 08:31
  • It depends on the project - you're probably looking for the community edition. And I'm not worried if you're into RMI now - you'l learn to hate it soon and start looking for alternatives. :) – Joseph Ottinger May 25 '11 at 10:11
2

In Feb 2009 another user on SO mentioned, that GigaSpaces is a mature version of JavaSpaces.

Looking at that older question, I start believing that JavaSpaces is dead..!?

Community
  • 1
  • 1
Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268
  • 1
    JavaSpaces isn't dead by any measure. It's just not very popular. GigaSpaces improves on it by extending the base API and wrapping other APIs on top of it, so you can use JavaSpaces via JMS, memcached, JPA, JDBC, a map API, and a document API - among others. – Joseph Ottinger May 24 '11 at 10:49
2

Have you considered also using something like RMI where it becomes transparent the fact that you are invoking a method on a remote system? Or JMS where you just send and read messages -- and the infrastructure routes them to the right place/process? Or how about another approach where you have a network cache (e.g. memcached) where both processes can put and get items to/from the cache -- thus allowing for inter-process communication to a certain extent?

Liv
  • 6,006
  • 1
  • 22
  • 29
  • do you have a example for RMI (read about it, but couldn't find working examples) – Stefan May 24 '11 at 10:25
  • 1
    Sun (Oracle I mean) have a tutorial on RMI with working code -- here: http://download.oracle.com/javase/tutorial/rmi/index.html – Liv May 24 '11 at 10:27