org.apache.geronimo.clustering
Interface SessionManager


public interface SessionManager

Represents a local SessionManager.

A local SessionManager works collaboratively with remote SessionManagers to manage Session instances. A local SessionMananger along with its associated remote SessionManagers are a single space where Session instances live. In this space, each Session is ensured to have a unique sessionId. This contract is enforced during creation of a Session instance by a local SessionManager. A Session in this space is preemptively migrated from one local SessionManager to another. The interposition of a ClusteredInvocation between a Client and the Session he wants to access ensures that at any point in time a Session is uniquely instantiated once cluster wide. Clients can receive migration callbacks via the registration of SessionListener.


Method Summary
 Session createSession(String sessionId)
          Creates a Session having the specified sessionId.
 Node getNode()
          Gets the Node hosting this local SessionManager.
 void registerListener(SessionListener listener)
          Registers a migration listener.
 void unregisterListener(SessionListener listener)
          Unregisters a migration listener.
 

Method Detail

createSession

Session createSession(String sessionId)
                      throws SessionAlreadyExistException
Creates a Session having the specified sessionId.

Parameters:
sessionId - Unique identifier of the Session instance.
Returns:
Session instance.
Throws:
SessionAlreadyExistException - Thrown when the provided sessiondId already exists in the Session space of this local SessionManager and its associated remote SessionManagers.

registerListener

void registerListener(SessionListener listener)
Registers a migration listener.


unregisterListener

void unregisterListener(SessionListener listener)
Unregisters a migration listener.


getNode

Node getNode()
Gets the Node hosting this local SessionManager.

Returns:
Hosting Node.


Copyright © 2006 Apache Software Foundation. All Rights Reserved.