
JavaGroups 0.9.5
----------------

JavaGroups is an open source toolkit for reliable IP multicast-based
group communication. It is written entirely in Java.

JavaGroups consists of an API (Channel) which is similar to a
socket, and a protocol stack which - depending on its composition -
provides varying degrees of reliability.

Developers can use/replace/remove/modify existing protocols and/or
add new ones to accommodate the different needs of their
applications. JavaGroups is a testbed for the development of new
group communication protocols using Java.

The protocols in the current version implement Virtual Synchrony.



More Information / Download
---------------------------
http://www.cs.cornell.edu/Info/Projects/JavaGroupsNew




Sample code
-----------

String  props;
Message send_msg, recv_msg;
Channel channel;

props="UDP:PING:FD:STABLE:NAKACK:UNICAST:FRAG(size=32000)"+
      ":FLUSH:GMS:VIEW_ENFORCER:STATE_TRANSFER:QUEUE";
channel=new JChannel(props);
send_msg=new Message(null, null, "Hello world");

channel.Connect("MyGroup");
channel.Send(send_msg);
recv_msg=(Message)channel.Receive(0);
System.out.println("Received msg " + recv_msg);
channel.Disconnect();
channel.Close();


First a channel (similar to a UDP socket) is created, with
properties that include IP multicast (UDP), failure detection (FD),
multicast message garbage collection (STABLE), loss-less and fifo
message transmission (UNICAST/NAKACK), fragmentation, group
membership (PING/GMS/FLUSH/VIEW_ENFORCER) and state transfer
(STATE_TRANSFER).

Then the channel joins the "MyGroup" group using Connect() and a
message is sent to all members of "MyGroup" (including the
sender). The message contains 3 fields: receiver (send to all if
'null'), sender ('null', will be set by protocol stack before
message is put on the network) and a byte buffer (the "Hello world"
String object is serialized into it). A reply r to a multicast
message m can be created by setting r.receiver = m.sender and using
channel.Send(r) to send it.

Then a message is received using the Receive() method
(blocking). Finally the member leaves the group using
Disconnect(). This causes a notification to be sent to all members
registered for membership change notifications.
