jgroup.relacs.rmi
Class SynchAckListener

java.lang.Object
  extended by jgroup.relacs.rmi.SynchAckListener
All Implemented Interfaces:
java.rmi.Remote, AckListener

public final class SynchAckListener
extends java.lang.Object
implements AckListener

This class is used to collect return values of synchronous internal group method invocations. For each invocation, an object of this class is instantiated. When an invocation is performed, method notifyView() is invoked to communicate to this object the number and the identities of the members included in the view in which the method is executed. Method ack() is used to add the return value returned by the specified member. Method viewChange() is used to notify objects of this class that a new view has been installed and members not responding are to be considered unreachable.

Since:
Jgroup 0.9
Author:
Alberto Montresor

Constructor Summary
SynchAckListener(DispatcherService dispatcher)
           
 
Method Summary
 void ack(MemberId id, int vpos, java.lang.Object obj)
          Upcalls invoked by Jgroup to notify the ack listener that the member identified by id has responded with obj to the multicast message associated with this ack listener.
 AckListener getRemoteAckListener()
          Get a reference for the remote AckListener.
 java.lang.Object getResults()
          Wait for and obtain the results.
 void notifyView(View view)
          Upcalls invoked by Jgroup to notify the ack listener about the view in which the multicast message is delivered.
 void viewChange()
          Upcalls invoked by Jgroup to notify the ack listener that a new view has been installed after the view in which the message has been delivered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchAckListener

public SynchAckListener(DispatcherService dispatcher)
Method Detail

getRemoteAckListener

public AckListener getRemoteAckListener()
                                 throws java.rmi.server.ExportException
Get a reference for the remote AckListener.

Returns:
A remote proxy for the SynchAckListener.
Throws:
java.rmi.server.ExportException - Raised if the SyncAckListener could not be exported.

notifyView

public void notifyView(View view)
                throws java.rmi.RemoteException
Description copied from interface: AckListener
Upcalls invoked by Jgroup to notify the ack listener about the view in which the multicast message is delivered. Note that following the Jgroup specification, a message may be delivered in a view different from the one in which the message has been multicast; this is motivated by the fact that during agreement protocols, no new messages can be delivered; in fact, cascading sequences of delivered messages could prevent the completion of agreement protocols.

This property corresponds to the Same View Delivery property of the GCS-Survery paper of Chockler et al, which states that all those who deliver a message must do so in the same view, however without requiring that this occur in the same view as it was sent.

Specified by:
notifyView in interface AckListener
Parameters:
view - the view in which the multicast message is delivered
Throws:
java.rmi.RemoteException

ack

public void ack(MemberId id,
                int vpos,
                java.lang.Object obj)
         throws java.rmi.RemoteException
Description copied from interface: AckListener
Upcalls invoked by Jgroup to notify the ack listener that the member identified by id has responded with obj to the multicast message associated with this ack listener.

Member id is contained in the view notified by notifyView.

Specified by:
ack in interface AckListener
Parameters:
id - the identifier of the member responding to the multicast message
vpos - position of the member in the last installed view
obj - the response message
Throws:
java.rmi.RemoteException

viewChange

public void viewChange()
                throws java.rmi.RemoteException
Description copied from interface: AckListener
Upcalls invoked by Jgroup to notify the ack listener that a new view has been installed after the view in which the message has been delivered. After this event, no missing response messages for the multicast message associated with this ack listener will ever be accepted.

Specified by:
viewChange in interface AckListener
Throws:
java.rmi.RemoteException

getResults

public java.lang.Object getResults()
Wait for and obtain the results.



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