1/*2 * Copyright (c) 1998-2002 The Jgroup Team.3 *4 * This program is free software; you can redistribute it and/or modify5 * it under the terms of the GNU Lesser General Public License version 2 as6 * published by the Free Software Foundation.7 *8 * This program is distributed in the hope that it will be useful,9 * but WITHOUT ANY WARRANTY; without even the implied warranty of10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11 * GNU Lesser General Public License for more details.12 *13 * You should have received a copy of the GNU Lesser General Public License14 * along with this program; if not, write to the Free Software15 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.16 *17 */1819package jgroup.core.multicast;
2021import java.io.InputStream;
2223import jgroup.core.MemberId;
2425/**26 * This interface enables members to receive message delivery27 * notifications. Members implementing this interface must be able to28 * react in a suitable way to the delivery of messages composed either29 * by single objects or an input stream.30 *31 * @author Alberto Montresor32 * @author Hein Meling33 * @since Jgroup 0.734 */35publicinterfaceMulticastListener36 {
3738/**39 * Returns a string naming the protocol implemented by this multicast40 * listener.41 */42public String getProtocolName();
434445/**46 * Upcall that is invoked by Jgroup to deliver a message <code>msg</code>,47 * corresponding to an input stream from which the message may be read.48 *49 * @param msg the input stream from which the message can be read.50 * @param sender the sender of the multicast message51 * @param seqNo the sequence number of this multicast message 52 * @return an object that will be delivered to the invoker through the53 * <tt>AckListener</tt> object specified when multicasting the message.54 */55public Object deliverStream(InputStream msg, MemberId sender, int seqNo);
565758/**59 * Upcall that is invoked by Jgroup to deliver a message <code>msg</code>,60 * corresponding to a single serialized object.61 *62 * @param msg the object that was multicasted.63 * @param sender the sender of the multicast message64 * @param seqNo the sequence number of this multicast message 65 * @return an object that will be delivered to the invoker through the66 * <tt>AckListener</tt> object specified when multicasting the message.67 */68public Object deliverObject(Object msg, MemberId sender, int seqNo);
6970 } // END MulticastListener