jgroup.core.multicast
Interface MulticastService

All Superinterfaces:
Layer
All Known Implementing Classes:
MulticastLayer, TotalOrderLayer

public interface MulticastService
extends Layer

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, Hein Meling

Nested Class Summary
 
Nested classes/interfaces inherited from interface jgroup.core.Layer
Layer.FinalizeLayer
 
Method Summary
 java.io.OutputStream getMessage(java.lang.String protocol)
          Returns an output stream to be used to encode a message.
 void mcast(java.io.OutputStream out, AckListener ackl)
          Multicast a message enclosed in the stream out to the members of the current view of the group.
 void mcast(java.io.OutputStream out, AckListener ackl, ChainIdentifier chainId)
          Multicast a message enclosed in the stream out to the members of the current view of the group.
 void mcast(java.lang.String protocol, java.lang.Object obj, AckListener ackl)
          Multicast a serializable object to the members of the current view of a group.
 
Methods inherited from interface jgroup.core.Layer
addListener
 

Method Detail

mcast

void mcast(java.io.OutputStream out,
           AckListener ackl,
           ChainIdentifier chainId)
           throws JgroupException
Multicast a message enclosed in the stream out 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:
out - The stream message to be multicast.
ackl - Acknowledgement listener to be notified; if null, no listener will be notified.
chainId - Identifier of a previous message (delivered through a deliverStream). This is only required for multicast messages that relate to some previous multicast message. It will only be used in extremely rare cases, to avoid that the membership service delays the message while running the agreement protocol, which would otherwise prevent the agreement protocol from concluding.
Throws:
java.lang.UnsupportedOperationException - Raised if the member associated with this group manager is not a MulticastListener, and thus is unable to receive messages.
JgroupException - Rasied 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 the group.

mcast

void mcast(java.io.OutputStream out,
           AckListener ackl)
           throws JgroupException
Multicast a message enclosed in the stream out 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:
out - The stream message to be multicast.
ackl - Acknowledgement listener to be notified; if null, no listener will be notified.
Throws:
java.lang.UnsupportedOperationException - Raised if the member associated with this group manager is not a MulticastListener, and thus is unable to receive messages.
JgroupException - Rasied 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 the group.

mcast

void mcast(java.lang.String protocol,
           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:
protocol - The protocol for the message object to be multicast.
obj - The message object to be multicast.
ackl - Acknowledgement listener to be notified; if null, no listener will be notified.
Throws:
java.lang.UnsupportedOperationException - Raised if the member associated with this group manager is not a MulticastListener, and thus is unable to receive messages.
JgroupException - Rasied 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 the group.
java.io.IOException - Raised if the object to be multicast could not be serialized.

getMessage

java.io.OutputStream getMessage(java.lang.String protocol)
                                throws java.io.IOException
Returns an output stream to be used to encode a message. Method mcast(OutputStream, AckListener) accepts only multicast messages obtained through this method. The provided output stream is a memory data structure optimized to avoid useless data copies.

Parameters:
protocol - The protocol name used for the OutputStream message object to be multicast.
Throws:
java.io.IOException


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.