|
Eclipse Rich Ajax Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 (HttpSessionListener
s
don't work with RAP). This gives the possibility to cleanup on session
shutdown with the session singleton infrastructure intact.
Method Summary | |
---|---|
boolean |
addSessionStoreListener(SessionStoreListener listener)
Adds an instance of SessionStoreListener to this
ISessionStore . |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the object bound with the specified name in this ISessionStore , or null if no object is bound
under the name. |
java.util.Enumeration<java.lang.String> |
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. |
java.lang.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. |
boolean |
removeAttribute(java.lang.String name)
Removes the object bound with the specified name from this ISessionStore . |
boolean |
removeSessionStoreListener(SessionStoreListener listener)
Removes an instance of SessionStoreListener to this
ISessionStore . |
boolean |
setAttribute(java.lang.String name,
java.lang.Object value)
Binds an object to this ISessionStore , using the name
specified. |
Method Detail |
---|
boolean setAttribute(java.lang.String name, java.lang.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
true
if the attribute was set or false
if the attribute could not be set because the session was
invalidated.
java.lang.Object getAttribute(java.lang.String name)
ISessionStore
, or null
if no object is bound
under the name.
name
- a string specifying the name of the object; cannot be null
null
if the
underlying session was invalidated.boolean removeAttribute(java.lang.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
; cannot be null
true
if the attribute was removed or
false
if the attribute could not be removed because
the session was invalidated.isBound()
java.util.Enumeration<java.lang.String> 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
or an empty enumeration if the
underlying session was invalidated.isBound()
java.lang.String getId()
HttpSession
.
The identifier is assigned by the servlet container and is implementation
dependent.
HttpSession
.boolean 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
true
if the listener was added or false
if the listener could not be added because the session was
invalidated.isBound()
boolean 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
true
if the listener was removed or false
if the listener could not be removed because the session was
invalidated.isBound()
HttpSession getHttpSession()
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 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) EclipseSource and others 2002, 2012. All rights reserved.