com.sun.sgs.service
Interface ClientSessionStatusListener


public interface ClientSessionStatusListener

A listener that services may register with the ClientSessionService to receive notification of local client session status changes such as disconnection or relocation.

See Also:
ClientSessionService.addSessionStatusListener(com.sun.sgs.service.ClientSessionStatusListener)

Method Summary
 void disconnected(BigInteger sessionRefId, boolean isRelocating)
          Notifies this listener that the session with the given sessionRefId has disconnected so that any relevant cached or persistent data associated with the client session can be cleaned up.
 void prepareToRelocate(BigInteger sessionRefId, long newNodeId, SimpleCompletionHandler handler)
          Notifies this listener that the session with the given sessionRefId is relocating to the node with the specified nodeId.
 void relocated(BigInteger sessionRefId)
          Notifies this listener that the session with the given sessionRefId has completed relocation to the local node, so that this listener can communicate with the relocated client session (e.g.
 

Method Detail

disconnected

void disconnected(BigInteger sessionRefId,
                  boolean isRelocating)
Notifies this listener that the session with the given sessionRefId has disconnected so that any relevant cached or persistent data associated with the client session can be cleaned up.

Parameters:
sessionRefId - the client session ID
isRelocating - if true, the disconnection is due to the client session relocating to another node

prepareToRelocate

void prepareToRelocate(BigInteger sessionRefId,
                       long newNodeId,
                       SimpleCompletionHandler handler)
Notifies this listener that the session with the given sessionRefId is relocating to the node with the specified nodeId. This notification gives the service associated with this listener an opportunity to prepare for the relocation. The associated service should invoke the completed method of the specified handler when it has completed preparing for the relocation.

Parameters:
sessionRefId - the client session ID
newNodeId - the ID of the new node
handler - a handler to notify when preparation is complete

relocated

void relocated(BigInteger sessionRefId)
Notifies this listener that the session with the given sessionRefId has completed relocation to the local node, so that this listener can communicate with the relocated client session (e.g. to deliver enqueued requests) if needed.

Parameters:
sessionRefId - the client session ID

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