SessionAdapterpublic class BasicSessionAdapter extends AbstractSessionAdapter
adaptee| Constructor | Description |
|---|---|
BasicSessionAdapter(SessionAgent agent) |
Instantiates a new BasicSessionAdapter.
|
| Modifier and Type | Method | Description |
|---|---|---|
Session |
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.
|
SessionAgent |
getSessionAgent() |
|
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 secs) |
toStringpublic BasicSessionAdapter(SessionAgent agent)
agent - the session agentpublic Session getAdaptee()
SessionAdaptergetAdaptee in interface SessionAdaptergetAdaptee in class AbstractSessionAdapterpublic 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 secs)
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()
SessionAdapterpublic SessionScope getSessionScope()
SessionAdapterpublic SessionAgent getSessionAgent()
Copyright © 2008–2018 The Aspectran Project. All rights reserved.