|
Eclipse Rich Ajax Platform Release 1.3 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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 |
public void setAttribute(String name, Object value)
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()
.
name
- the name to which the object is bound;
cannot be nullvalue
- the object to be bound
IllegalStateException
- If this method is called on an
invalidated session
public Object getAttribute(String name)
ISessionStore
, or null
if no object is bound
under the name.
name
- a string specifying the name of the object
IllegalStateException
- If this method is called on an invalidated
session.public void removeAttribute(String name)
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.
name
- The name of the object to remove from this
ISessionStore
.
IllegalStateException
- If this method is called on an invalidated
session.public Enumeration getAttributeNames()
Enumeration
of String
objects
containing the names of all the objects bound to this
ISessionStore
.
Enumeration
of String
objects
specifying the names of all the objects bound to this
ISessionStore
.
IllegalStateException
- If this method is called on an invalidated
session.public String getId()
HttpSession
.
The identifier is assigned by the servlet container and is implementation
dependent.
HttpSession
.
IllegalStateException
- If this method is called on an invalidated
session.public void addSessionStoreListener(SessionStoreListener listener)
SessionStoreListener
to this
ISessionStore
. SessionStoreListener
s are
used to get notifications before the session store is destroyed.
If the given listener is already added the method has no effect.
listener
- the SessionStoreListener to be added
IllegalStateException
- If this method is called on an invalidated
session.public void removeSessionStoreListener(SessionStoreListener listener)
SessionStoreListener
to this
ISessionStore
. SessionStoreListener
s are
used to get notifications before the session store is destroyed.
If the given listener is not added to the session store this method
has no effect.
listener
- the SessionStoreListener to be removed
IllegalStateException
- If this method is called on an invalidated
session.public HttpSession getHttpSession()
public boolean isBound()
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.
|
Eclipse Rich Ajax Platform Release 1.3 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) Innoopract Informationssysteme GmbH and others 2002, 2009. All rights reserved.