Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Rich Ajax Platform
Release 1.2

org.eclipse.rwt.service
Interface ISessionStore


public interface ISessionStore

The ISessionStore represents a storage place for objects with session scope. The session store itself is stored in the servlet container's session. Different than the HttpSession it is possible to register programmatically a listener that is notified before the session store will be destroyed (HttpSessionListeners don't work with RAP). This gives the possibility for cleanup on session shutdown with the session singleton based infrastructure intact.

This interface is not intended to be implemented by clients.

Since:
1.0

Method Summary
 void addSessionStoreListener ( SessionStoreListener listener)
          Adds an instance of SessionStoreListener to this ISessionStore.
  Object getAttribute ( String name)
          Returns the object bound with the specified name in this ISessionStore, or null if no object is bound under the name.
  Enumeration getAttributeNames ()
          Returns an Enumeration of String objects containing the names of all the objects bound to this ISessionStore.
 HttpSession getHttpSession ()
          Returns the underlying HttpSession instance.
  String getId ()
          Returns a string containing the unique identifier assigned to the underlying HttpSession.
 boolean isBound ()
          Returns whether this ISessionStore is bound to the underlying HttpSession or not.
 void removeAttribute ( String name)
          Removes the object bound with the specified name from this ISessionStore.
 void removeSessionStoreListener ( SessionStoreListener listener)
          Removes an instance of SessionStoreListener to this ISessionStore.
 void setAttribute ( String name, Object value)
          Binds an object to this ISessionStore, using the name specified.
 

Method Detail

setAttribute

public void setAttribute(
String name,
                         
Object value)
Binds an object to this ISessionStore, using the name specified. If an object of the same name is already bound to the ISessionStore the object is replaced.

After this method executes, and if the new object implements HttpSessionBindingListener, the ISessionStore calls HttpSessionBindingListener.valueBound.

If an object was already bound to this ISessionStore of this name that implements HttpSessionBindingListener, its HttpSessionBindingListener.valueUnbound method is called.

If the value passed in is null, this has the same effect as calling removeAttribute().

Parameters:
name - the name to which the object is bound; cannot be null
value - the object to be bound
Throws:
IllegalStateException - If this method is called on an invalidated session

getAttribute

public 
Object getAttribute(
String name)
Returns the object bound with the specified name in this ISessionStore, or null if no object is bound under the name.

Parameters:
name - a string specifying the name of the object
Returns:
the object with the specified name
Throws:
IllegalStateException - If this method is called on an invalidated session.

removeAttribute

public void removeAttribute(
String name)
Removes the object bound with the specified name from this ISessionStore. If no object is bound with the specified name, this method does nothing.

After this method executes, and if the object implements HttpSessionBindingListener, the HttpSessionBindingListener.valueUnbound is called.

Parameters:
name - The name of the object to remove from this ISessionStore.
Throws:
IllegalStateException - If this method is called on an invalidated session.

getAttributeNames

public 
Enumeration getAttributeNames()
Returns an Enumeration of String objects containing the names of all the objects bound to this ISessionStore.

Returns:
An Enumeration of String objects specifying the names of all the objects bound to this ISessionStore.
Throws:
IllegalStateException - If this method is called on an invalidated session.

getId

public 
String getId()
Returns a string containing the unique identifier assigned to the underlying HttpSession. The identifier is assigned by the servlet container and is implementation dependent.

Returns:
A string specifying the identifier assigned to the underlying HttpSession.
Throws:
IllegalStateException - If this method is called on an invalidated session.

addSessionStoreListener

public void addSessionStoreListener(
SessionStoreListener listener)
Adds an instance of SessionStoreListener to this ISessionStore. SessionStoreListeners are used to get notifcations before the session store is destroyed. If the given listenern is already added the method has no effect.

Parameters:
listener - the SessionStoreListener to be added
Throws:
IllegalStateException - If this method is called on an invalidated session.

removeSessionStoreListener

public void removeSessionStoreListener(
SessionStoreListener listener)
Removes an instance of SessionStoreListener to this ISessionStore. SessionStoreListeners are used to get notifcations before the session store is destroyed. If the given listener is not added to the session store this method has no effect.

Parameters:
listener - the SessionStoreListener to be removed
Throws:
IllegalStateException - If this method is called on an invalidated session.

getHttpSession

public HttpSession getHttpSession()
Returns the underlying HttpSession instance.

Returns:
the HttpSession instance

isBound

public boolean isBound()
Returns whether this ISessionStore is bound to the underlying HttpSession or not. If the session store is unbound it behaves as if the http session it belonged to was invalidated.

Returns:
true if the session store is bound, false otherwise.

Eclipse Rich Ajax Platform
Release 1.2

Copyright (c) Innoopract Informationssysteme GmbH and others 2002, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire