SessionAdapterpublic class HttpSessionAdapter extends AbstractSessionAdapter
adaptee| Constructor | Description |
|---|---|
HttpSessionAdapter(javax.servlet.http.HttpServletRequest request,
ActivityContext context) |
Instantiates a new HttpSessionAdapter.
|
| Modifier and Type | Method | Description |
|---|---|---|
javax.servlet.http.HttpSession |
getAdaptee() |
Returns the adaptee object to provide session information.
|
<T> T |
getAttribute(java.lang.String name) |
Returns the value of the named attribute as a given type,
or
null if no attribute of the given name exists. |
java.util.Enumeration<java.lang.String> |
getAttributeNames() |
Returns an Enumeration of String objects containing the names
of all the objects bound to this session.
|
long |
getCreationTime() |
Returns the time when this session was created, measured
in milliseconds since midnight January 1, 1970 GMT.
|
java.lang.String |
getId() |
Returns a string containing the unique identifier assigned to this session.
|
long |
getLastAccessedTime() |
Returns the last time the client sent a request associated with this session,
as the number of milliseconds since midnight January 1, 1970 GMT,
and marked by the time the container received the request.
|
int |
getMaxInactiveInterval() |
Returns the maximum time interval, in seconds, that the servlet container will keep
this session open between client accesses.
|
protected javax.servlet.http.HttpSession |
getSession(boolean create) |
|
SessionScope |
getSessionScope() |
Gets the session scope.
|
void |
invalidate() |
Invalidates this session then unbinds any objects bound to it.
|
boolean |
isNew() |
|
void |
removeAttribute(java.lang.String name) |
Removes the object bound with the specified name from this session.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value) |
Stores an attribute in this session.
|
void |
setMaxInactiveInterval(int interval) |
toStringpublic HttpSessionAdapter(javax.servlet.http.HttpServletRequest request,
ActivityContext context)
request - the HTTP requestcontext - the current activity contextpublic javax.servlet.http.HttpSession getAdaptee()
SessionAdaptergetAdaptee in interface SessionAdaptergetAdaptee in class AbstractSessionAdapterpublic SessionScope getSessionScope()
SessionAdapterpublic java.lang.String getId()
SessionAdapterpublic boolean isNew()
public long getCreationTime()
SessionAdapterpublic long getLastAccessedTime()
SessionAdapterpublic int getMaxInactiveInterval()
SessionAdaptersetMaxInactiveInterval method.
A negative time indicates the session should never timeout.public void setMaxInactiveInterval(int interval)
public java.util.Enumeration<java.lang.String> getAttributeNames()
SessionAdapterpublic <T> T getAttribute(java.lang.String name)
SessionAdapternull if no attribute of the given name exists.T - the generic typename - a String specifying the name of the attributeObject containing the value of the attribute,
or null if the attribute does not existpublic void setAttribute(java.lang.String name,
java.lang.Object value)
SessionAdaptername - specifying the name of the attributevalue - the Object to be storedpublic void removeAttribute(java.lang.String name)
SessionAdaptername - the name of the object to remove from this sessionpublic void invalidate()
SessionAdapterprotected javax.servlet.http.HttpSession getSession(boolean create)
Copyright © 2008–2018 The Aspectran Project. All rights reserved.