jgroup.multicast
Interface MulticastService


public interface MulticastService

The facilities provided by the reliable multicast service included in Jgroup may be accessed using the MulticastService interface. Methods in this interfaces enable members of a group to communicate among themselves by multicasting messages or complex objects.

Instances of MulticastService may be obtained through the GroupManager class.

Since:
Jgroup 0.8
Author:
Alberto Montresor

Method Summary
 java.io.OutputStream getMessage()
          Returns an output stream that can be used to encode the message.
 void mcast(java.lang.Object obj, AckListener ackl)
          Multicast a serializable object to the members of the current view of a group.
 void mcast(java.io.OutputStream out, AckListener ackl)
          Multicast a message enclosed in stream to the members of the current view of the group.
 

Method Detail

mcast

public void mcast(java.io.OutputStream out,
                  AckListener ackl)
           throws JgroupException
Multicast a message enclosed in stream to the members of the current view of the group.

The invoker may specify an AckListener object, which will be notified when objects returned by members delivering this message are received.

Parameters:
stream - the message
ackl - ack listener to be notified; if null, no ack listener is notified.
Throws:
UnsupportedOperationException - Raised if the member associated with this group manager is not a MulticastListener, and thus is not able to receive message deliveries.
JgroupException - if the group manager receives a request to multicast a message after having joined a group, but before having received the first view for it; or after having requested to leave a group.

mcast

public void mcast(java.lang.Object obj,
                  AckListener ackl)
           throws JgroupException,
                  java.io.IOException
Multicast a serializable object to the members of the current view of a group.

The invoker may specify an AckListener object, which will be notified when objects returned by members delivering this message are received.

Parameters:
obj - the message that must be multicast
ackl - ack listener to be notified; if null, no ack listener is notified
Throws:
UnsupportedOperationException - Raised if the member associated with this group manager is not a MulticastListener, and thus is not able to receive message deliveries.
JgroupException - if the group manager receives a request to multicast a message after having joined a group, but before having received the first view for it; or after having requested to leave a group.
java.io.IOException - Raised in the case of serialization problems

getMessage

public java.io.OutputStream getMessage()
Returns an output stream that can be used to encode the message. Method mcast(OutputStream, AckListener) accepts only output streams obtained with this method.