com.sun.sgs.service
Interface ClientSessionService

All Superinterfaces:
Service
All Known Implementing Classes:
ClientSessionServiceImpl

public interface ClientSessionService
extends Service

The client session service manages client sessions.


Method Summary
 void addSessionStatusListener(ClientSessionStatusListener listener)
          Adds the specified status listener to be notified when a local session disconnects or is being prepared to relocate.
 SessionProtocol getSessionProtocol(BigInteger sessionRefId)
          Returns a protocol for the local client session with the specified sessionRefId or null if the specified client session is not connected to the local node.
 boolean isRelocatingToLocalNode(BigInteger sessionRefId)
          Returns true if the session with the specified sessionRefId is known to be relocating to the local node, and returns false otherwise.
 
Methods inherited from interface com.sun.sgs.service.Service
getName, ready, shutdown
 

Method Detail

addSessionStatusListener

void addSessionStatusListener(ClientSessionStatusListener listener)
Adds the specified status listener to be notified when a local session disconnects or is being prepared to relocate. This method is non-transactional and should be called outside of a transaction.

Parameters:
listener - a listener to notify when a session disconnects or is being prepared to relocate
Throws:
IllegalStateException - if this method is invoked from a transactional context

getSessionProtocol

SessionProtocol getSessionProtocol(BigInteger sessionRefId)
Returns a protocol for the local client session with the specified sessionRefId or null if the specified client session is not connected to the local node.

The sessionRefId is the ID obtained by invoking getId on a ManagedReference to the associated ClientSession.

This method is non-transactional. However, the method may be invoked inside or outside of a transaction. The SessionProtocol returned from this method is used to communicate with a client, so it should only be used outside of a transaction.

Parameters:
sessionRefId - a client session ID, as a BigInteger
Returns:
a protocol, or null
Throws:
IllegalStateException - if this method is invoked from a transactional context

isRelocatingToLocalNode

boolean isRelocatingToLocalNode(BigInteger sessionRefId)
Returns true if the session with the specified sessionRefId is known to be relocating to the local node, and returns false otherwise.

Parameters:
sessionRefId - a client session ID, as a BigInteger
Returns:
true if the session with the specified sessionRefId is known to be relocating to the local node, and returns false otherwise

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