@Override protected ISessionStore newSessionStore() { return new SecondLevelCacheSessionStore(this, new IPageStore() { public void destroy() { } public Page getPage(String sessionId, String pagemap, int id, int versionNumber, int ajaxVersionNumber) { return null; } public void pageAccessed(String sessionId, Page page) { } public void removePage(String sessionId, String pagemap, int id) { } public void storePage(String sessionId, Page page) { } public void unbind(String sessionId) { } public boolean containsPage(String sessionId, String pageMapName, int pageId, int pageVersion) { return false; } }); } }
/** * @see org.apache.wicket.protocol.http.AbstractHttpSessionStore#onUnbind(java.lang.String) */ @Override protected void onUnbind(String sessionId) { getStore().unbind(sessionId); } }
public void deserializePage(int id, String pageMapName, Page page, ObjectInputStream stream) throws IOException, ClassNotFoundException { // get the page instance registry IntHashMap<Page> pages = SecondLevelCacheSessionStore.getUsedPages(pageMapName); // register the new page instance so that when the same page is being deserialized // (curricular page references) we can use existing page instance (otherwise deadlock // would happen) pages.put(id, page); stream.defaultReadObject(); } }
protected ISessionStore newSessionStore() return new SecondLevelCacheSessionStore(this, new IPageStore()
/** * @see org.apache.wicket.protocol.http.AbstractHttpSessionStore#onUnbind(java.lang.String) */ protected void onUnbind(String sessionId) { getStore().unbind(sessionId); } }
public void deserializePage(int id, String pageMapName, Page page, ObjectInputStream stream) throws IOException, ClassNotFoundException { // get the page instance registry HashMap pageMaps = (HashMap)SecondLevelCacheSessionStore.getUsedPages().get(); if (pageMaps == null) { pageMaps = new HashMap(); SecondLevelCacheSessionStore.getUsedPages().set(pageMaps); } IntHashMap pages = (IntHashMap)pageMaps.get(pageMapName); if (pages == null) { pages = new IntHashMap(); pageMaps.put(pageMapName, pages); } // register the new page instance so that when the same page is being deserialized // (curricular page references) we can use existing page instance (otherwise deadlock // would happen) pages.put(id, page); stream.defaultReadObject(); } }
@Override protected ISessionStore newSessionStore() return new SecondLevelCacheSessionStore(this, new IPageStore()
/** * @see org.apache.wicket.protocol.http.AbstractHttpSessionStore#destroy() */ @Override public void destroy() { super.destroy(); getStore().destroy(); }
public Page get(int id, int versionNumber) IntHashMap<Page> pages = getUsedPages(getName());
/** * @see org.apache.wicket.Application#newSessionStore() */ protected ISessionStore newSessionStore() { return new SecondLevelCacheSessionStore(this, new DiskPageStore()); }
/** * @see org.apache.wicket.protocol.http.AbstractHttpSessionStore#destroy() */ public void destroy() { super.destroy(); getStore().destroy(); }
/** * @see org.apache.wicket.Application#newSessionStore() */ @Override protected ISessionStore newSessionStore() { DiskPageStore store; try { store = new DiskPageStore(); } catch (SecurityException e) { throw new WicketRuntimeException( "SecurityException occurred while creating DiskPageStore. Consider overriding newSessionStore() in your application and using a PageStore that doesn't required disk access like: " + HttpSessionStore.class.getName(), e); } return new SecondLevelCacheSessionStore(this, store); }
private IPageStore getStore() { return ((SecondLevelCacheSessionStore)Application.get().getSessionStore()).getStore(); }
private IPageStore getStore() { return ((SecondLevelCacheSessionStore)Application.get().getSessionStore()).getStore(); }
private IPageStore getPageStore() { Application application = Application.get(applicationKey); if (application != null) { SecondLevelCacheSessionStore store = (SecondLevelCacheSessionStore)application.getSessionStore(); return store.getStore(); } else { // may happen when getPageStore() is called before application is initialized // for example on session initialization when cluster node starts return null; } }
private IPageStore getPageStore() { Application application = Application.get(applicationKey); if (application != null) { SecondLevelCacheSessionStore store = (SecondLevelCacheSessionStore)application.getSessionStore(); return store.getStore(); } else { // may happen when getPageStore() is called before application is initialized // for example on session initialization when cluster node starts return null; } }
.getSessionStore()).getStore();
.getSessionStore()).getStore();