jgroup.arm
Class RecoveryLayer

java.lang.Object
  extended by jgroup.arm.RecoveryLayer
All Implemented Interfaces:
RecoveryService, Layer, MembershipListener

public class RecoveryLayer
extends java.lang.Object
implements RecoveryService, MembershipListener

Recovery layer for providing the replication manager with view change events from groups assoicated with the replication manager. Note that the RecoveryListener does not provide any upcalls (it is only a marker interface), thus to listen for view change events, the replica should implement the MembershipListener. A server using the recovery layer need not implement the RecoveryListener, instead it simply needs to specify "Recovery" in the layer stack.

Since:
Jgroup 1.2
Author:
Hein Meling

Nested Class Summary
 
Nested classes/interfaces inherited from interface jgroup.core.Layer
Layer.FinalizeLayer
 
Nested classes/interfaces inherited from interface jgroup.core.MembershipListener
MembershipListener.AllowDuplicateViews
 
Method Summary
 void addListener(java.lang.Object listener)
          Add a listener for membership events.
static RecoveryLayer getLayer(MembershipService pgms)
           
 void hasLeft()
          Upcall that is invoked by Jgroup to acknowledge the fact that this object has left the group.
 void prepareChange()
          Upcall that is invoked by the group membership service to notify that the current view is not valid any more, and the group membership service is trying to reach an agreement on a new view.
 void viewChange(View view)
          Upcall that is invoked by the MembershipLayer when a view change occur in this replica's object group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLayer

public static RecoveryLayer getLayer(MembershipService pgms)
                              throws JgroupException,
                                     java.rmi.RemoteException
Throws:
JgroupException
java.rmi.RemoteException

addListener

public void addListener(java.lang.Object listener)
Add a listener for membership events. Since this layer sends view change events to the replication manager, we must provide special handling to use this layer from the replication manager. The replication manager must provide self-recovery through its local view changes. This layer is used by the replication manager to remove excessive replicas from the RM group.

Specified by:
addListener in interface Layer
Parameters:
listener - An Object representation of the listener interface. This will typically be cast to the appropriate listener interface type after checking the type with the instanceof operator.

viewChange

public void viewChange(View view)
Upcall that is invoked by the MembershipLayer when a view change occur in this replica's object group.

Specified by:
viewChange in interface MembershipListener
Parameters:
view - The new view object group.
See Also:
MembershipService

hasLeft

public void hasLeft()
Description copied from interface: MembershipListener
Upcall that is invoked by Jgroup to acknowledge the fact that this object has left the group. This method is only invoked after the leave method has been invoked on the group membership service.

Specified by:
hasLeft in interface MembershipListener
See Also:
MembershipService

prepareChange

public void prepareChange()
Description copied from interface: MembershipListener
Upcall that is invoked by the group membership service to notify that the current view is not valid any more, and the group membership service is trying to reach an agreement on a new view.

Specified by:
prepareChange in interface MembershipListener
See Also:
MembershipService


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