Class RMPChannel

All Implemented Interfaces:
channelInterface, java.lang.Cloneable, uka.karmi.rmi.Remote, RMPChannelInterface

public class RMPChannel
extends channelCore
implements RMPChannelInterface

Realizes a multi-channel of kind RMP. Its meta-behavior, together with the ReceiverStub's one, implements the Reliable Multicast Protolcol by Brian Whetten, Todd Montgomery and Simon Kaplan, which provides a totally ordered, reliable, atomic multicast service on top of an unreliable service.
It applies a message number to the message and sends it to the receiverStubs.
When results are returned from the receiverStubs it uses a voting algorithm to choose which result will be returned to the senderStub. It also allows the receiverStubs to request the retransmission of the message with the nACK method.
It uses instances of senderStub class as senderStubs, and instances of RMPReceiverStub as receiverStubs

Version 1.2
Michele Ferraro (
Luigi Tosetto (
Davide Zerbino (

Fields inherited from class uka.karmi.rmi.server.RemoteObject
Constructor Summary
RMPChannel(java.lang.String[] RsName)
          Constructor of RMP-multi-channels.
Method Summary
 java.lang.Object coreMetaBehavior(mChaRMMethodCall msg)
          This method embodies the reflective behaviour realized by the RMP-multi-channel.
 java.lang.String nACK(int n, java.lang.String name)
          Sends the message n to the receiver that has requested it
Methods inherited from class mChaRM.multichannel.channelCore
howManyReceivers, howManySenders, kind, receiverName, receiverStub, receiverStubByPosition, receiverStubClassName, retrieveReceiverFieldValue, retrieveSenderFieldValue, senderName, senderStub, senderStubByPosition, senderStubClassName, senderStubHasBeenCreated, setKind, setReceiverName, setReceiverStub, setReceiverStubClassName, setRsName, setSenderName, setSenderStub, setSenderStubClassName, supplyASenderStub
Methods inherited from class uka.karmi.rmi.server.UnicastRemoteObject
buildStub, clone, exportObject, exportObject, unexportObject
Methods inherited from class uka.karmi.rmi.server.RemoteObject
equals, hashCode, toString, toStub
Methods inherited from class java.lang.Object
, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface mChaRM.multichannel.channelInterface
senderStubHasBeenCreated, supplyASenderStub

Constructor Detail


public RMPChannel(java.lang.String[] RsName)
           throws uka.karmi.rmi.RemoteException,
Constructor of RMP-multi-channels.
This constructor calls the superclass' one fixing the kind "RMP" and specifing classes for senders and receivers that must be "senderStub" and "RMPReceiverStub" It initializes data structures for messages, results and, in the end, initializes the counter for ordering messages.
RsName - an Array of Strings representing the name of the receivers, which it is connected to.
ReceiverStubNotFoundException - thrown when one of the specified receiver wasn't started before the core.
Method Detail


public java.lang.String nACK(int n,
                             java.lang.String name)
                      throws MethodDoesNotExistException,
Sends the message n to the receiver that has requested it
If the message is correctly sent return the string "Ok"
Specified by:
nACK in interface RMPChannelInterface
n - number of the message required.
name - the name of the receiver.
"Ok" if all is right.


public java.lang.Object coreMetaBehavior(mChaRMMethodCall msg)
                                  throws MethodDoesNotExistException,
This method embodies the reflective behaviour realized by the RMP-multi-channel.
It performs meta-computations on the reified method call:
multiRMI(RsName, methodName, args)
the computations performed can't make assumption about where their are performed.
It adds to the message a progressive number then multicasts it to the receivers, collects the results and returns the most probable result (obtained with the voting method) of the computation to the sender.
Note that receivers can be a subset of the multi-channel's receivers
Specified by:
coreMetaBehavior in interface channelInterface
coreMetaBehavior in class channelCore
msg - the hijacked method call.
the result of the method call.
MethodDoesNotExistException - thrown when the method reified doesn't exist in the referent class.