com.sun.sgs.service
Interface IdentityRelocationListener


public interface IdentityRelocationListener

A service can register an IdentityRelocationListener to be notified when an identity is about to be relocated from the local node if it needs to perform any work in advance of the identity relocation.

See Also:
NodeMappingService.addIdentityRelocationListener(IdentityRelocationListener)

Method Summary
 void prepareToRelocate(Identity id, long newNodeId, SimpleCompletionHandler handler)
          Notifies this listener that the specified id has been selected for relocation to newNodeId and that this listener needs to prepare for that move.
 

Method Detail

prepareToRelocate

void prepareToRelocate(Identity id,
                       long newNodeId,
                       SimpleCompletionHandler handler)
Notifies this listener that the specified id has been selected for relocation to newNodeId and that this listener needs to prepare for that move. This method is invoked outside of a transaction.

When the listener has completed preparations for the identity relocation, the completed method of the specified handler must be invoked. After all listeners have noted they are ready for the move, the identity will be relocated and the new node will be returned from NodeMappingService.getNode(Identity) calls.

The implementation of this method should be idempotent because it may be invoked multiple times. If it is invoked multiple times, the completed method must be called for each handler provided.

Parameters:
id - the identity which has been selected for relocation
newNodeId - the identity of the node that id will move to
handler - a handler to notify when relocation preparations are complete

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved