org.wicketstuff.ki.wicket.page.store
Class SessionPageStore

java.lang.Object
  extended by org.apache.wicket.protocol.http.pagestore.AbstractPageStore
      extended by org.wicketstuff.ki.wicket.page.store.SessionPageStore
All Implemented Interfaces:
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore.IPageStore

public class SessionPageStore
extends org.apache.wicket.protocol.http.pagestore.AbstractPageStore

An IPageStore implementation that stores serialized Pages in JSecurity's Session. This implementation exists to support applications that use JSecurity's Enterprise Sessions instead of HTTP-only sessions.

In a distributed application, the JSecurity Session data might not reside on the same host that runs the Wicket application. In these cases the default DiskPageStore used by Wicket is not suitable. Instead Page state must be serialized to a mechanism that is 'cluster-friendly'.

JSecurity's enterprise Sessions are cluster-friendly, so storing pages in the Session is a good choice. This means applications can utilize true generic load balancing and do not need sticky sessions - the Wicket PageMap can be updated on one host which is then available for any next load-balanced request on another host because the Session is clustered.

Since:
Feb 13, 2009 4:25:12 PM
Author:
Les Hazlewood

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.protocol.http.pagestore.AbstractPageStore
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.SerializedPage
 
Field Summary
protected static int DEFAULT_MAX_PAGES
           
 
Constructor Summary
SessionPageStore()
           
SessionPageStore(int maxPageMapSize)
           
 
Method Summary
 boolean containsPage(java.lang.String sessionId, java.lang.String pageMapName, int pageId, int pageVersion)
           
 void destroy()
           
 int getMaxPageMapSize()
           
<T> org.apache.wicket.Page
getPage(java.lang.String sessionId, java.lang.String pageMapName, int id, int versionNumber, int ajaxVersionNumber)
           
protected  PageCacheManager getPageCacheManager(java.lang.String sessionId)
           
protected  org.jsecurity.session.Session getSession(java.lang.String sessionId)
           
protected  org.jsecurity.session.Session getSessionForUpdate(java.lang.String sessionId)
           
 void pageAccessed(java.lang.String sessionId, org.apache.wicket.Page page)
           
 void removePage(java.lang.String sessionId, java.lang.String pageMapName, int id)
           
protected  java.util.Collection<SerializedPageWrapper> serialize(org.apache.wicket.Page page)
           
 void storePage(java.lang.String sessionId, org.apache.wicket.Page page)
           
 void unbind(java.lang.String sessionId)
           
 
Methods inherited from class org.apache.wicket.protocol.http.pagestore.AbstractPageStore
deserializePage, serializePage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_PAGES

protected static final int DEFAULT_MAX_PAGES
See Also:
Constant Field Values
Constructor Detail

SessionPageStore

public SessionPageStore()

SessionPageStore

public SessionPageStore(int maxPageMapSize)
Method Detail

getMaxPageMapSize

public int getMaxPageMapSize()

getSessionForUpdate

protected org.jsecurity.session.Session getSessionForUpdate(java.lang.String sessionId)

getSession

protected org.jsecurity.session.Session getSession(java.lang.String sessionId)

destroy

public void destroy()

getPage

public <T> org.apache.wicket.Page getPage(java.lang.String sessionId,
                                          java.lang.String pageMapName,
                                          int id,
                                          int versionNumber,
                                          int ajaxVersionNumber)

pageAccessed

public void pageAccessed(java.lang.String sessionId,
                         org.apache.wicket.Page page)

removePage

public void removePage(java.lang.String sessionId,
                       java.lang.String pageMapName,
                       int id)

getPageCacheManager

protected PageCacheManager getPageCacheManager(java.lang.String sessionId)

serialize

protected java.util.Collection<SerializedPageWrapper> serialize(org.apache.wicket.Page page)

storePage

public void storePage(java.lang.String sessionId,
                      org.apache.wicket.Page page)

unbind

public void unbind(java.lang.String sessionId)

containsPage

public boolean containsPage(java.lang.String sessionId,
                            java.lang.String pageMapName,
                            int pageId,
                            int pageVersion)


Copyright © 2010. All Rights Reserved.