|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.protocol.http.AbstractHttpSessionStore
public abstract class AbstractHttpSessionStore
Abstract implementation of ISessionStore
that works with web applications and that
provided some specific http servlet/ session related functionality.
Nested Class Summary | |
---|---|
protected static class |
AbstractHttpSessionStore.SessionBindingListener
Reacts on unbinding from the session by cleaning up the session related application data. |
Field Summary | |
---|---|
protected WebApplication |
application
The web application for this store. |
Constructor Summary | |
---|---|
AbstractHttpSessionStore(Application application)
Construct. |
Method Summary | |
---|---|
void |
bind(Request request,
Session newSession)
Adds the provided new session to this facade using the provided request. |
IPageMap |
createPageMap(java.lang.String name,
Session session)
Deprecated. remove after deprecation release |
void |
destroy()
Called when the WebApplication is destroyed. |
protected javax.servlet.http.HttpSession |
getHttpSession(WebRequest request)
Gets the underlying HttpSession object or null. |
java.lang.String |
getSessionId(Request request,
boolean create)
Get the session id for the provided request. |
void |
invalidate(Request request)
Invalidates the session. |
Session |
lookup(Request request)
Retrieves the session for the provided request from this facade. |
IPageVersionManager |
newVersionManager(Page page)
|
void |
onBeginRequest(Request request)
Noop implementation. |
protected void |
onBind(Request request,
Session newSession)
Template method that is called when a session is being bound to the session store. |
void |
onEndRequest(Request request)
Noop implementation. |
protected void |
onUnbind(java.lang.String sessionId)
Template method that is called when the session is being detached from the store, which typically happens when the httpsession was invalidated. |
protected WebRequest |
toWebRequest(Request request)
Cast Request to WebRequest . |
void |
unbind(java.lang.String sessionId)
Removes a session from this facade |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.wicket.session.ISessionStore |
---|
createPageMap, getAttribute, getAttributeNames, removeAttribute, setAttribute |
Field Detail |
---|
protected final WebApplication application
Constructor Detail |
---|
public AbstractHttpSessionStore(Application application)
application
- The application to construct this store forMethod Detail |
---|
public final void bind(Request request, Session newSession)
ISessionStore
bind
in interface ISessionStore
request
- The request that triggered making a new sessionnewSession
- The new sessionISessionStore.bind(org.apache.wicket.Request,
org.apache.wicket.Session)
public final IPageMap createPageMap(java.lang.String name, Session session)
name
- session
-
public void destroy()
ISessionStore
destroy
in interface ISessionStore
ISessionStore.destroy()
public final java.lang.String getSessionId(Request request, boolean create)
ISessionStore
getSessionId
in interface ISessionStore
request
- The requestcreate
- Whether to create an actual session (typically an instance of HttpSession
)
when not already done so
ISessionStore.getSessionId(org.apache.wicket.Request, boolean)
public final void invalidate(Request request)
ISessionStore
invalidate
in interface ISessionStore
request
- the current requestISessionStore.invalidate(Request)
public Session lookup(Request request)
ISessionStore
This method should return null if it is not bound yet, so that Wicket can recognize that it
should create a session and call ISessionStore.bind(Request, Session)
right after that.
lookup
in interface ISessionStore
request
- The current request
ISessionStore.lookup(org.apache.wicket.Request)
public IPageVersionManager newVersionManager(Page page)
newVersionManager
in interface ISessionStore
page
- The page for which this version manager must be created
ISessionStore.newVersionManager(Page)
public void onBeginRequest(Request request)
onBeginRequest
in interface ISessionStore
request
- The request objectISessionStore.onBeginRequest(org.apache.wicket.Request)
public void onEndRequest(Request request)
onEndRequest
in interface ISessionStore
request
- The requestISessionStore.onEndRequest(org.apache.wicket.Request)
public final void unbind(java.lang.String sessionId)
ISessionStore
unbind
in interface ISessionStore
sessionId
- The id of the session that must be unbound.ISessionStore.unbind(java.lang.String)
protected final javax.servlet.http.HttpSession getHttpSession(WebRequest request)
WARNING: it is a bad idea to depend on the http session object directly. Please use the classes and methods that are exposed by Wicket instead. Send an email to the mailing list in case it is not clear how to do things or you think you miss functionality which causes you to depend on this directly.
request
-
protected void onBind(Request request, Session newSession)
ISessionStore.setAttribute(Request, String, Object)
with key
Session.SESSION_ATTRIBUTE_NAME
.
request
- The requestnewSession
- The new sessionprotected void onUnbind(java.lang.String sessionId)
sessionId
- The session id of the session that was invalidated.protected final WebRequest toWebRequest(Request request)
Request
to WebRequest
.
request
- The request to cast
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |