Author: knopp
Date: Mon Jul  7 09:31:07 2008
New Revision: 674545

URL: http://svn.apache.org/viewvc?rev=674545&view=rev
Log:
WICKET-1679

Modified:
    
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/DiskPageStore.java

Modified: 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/DiskPageStore.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/DiskPageStore.java?rev=674545&r1=674544&r2=674545&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/DiskPageStore.java
 (original)
+++ 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/DiskPageStore.java
 Mon Jul  7 09:31:07 2008
@@ -57,14 +57,14 @@
  * <p>
  * [EMAIL PROTECTED] DiskPageStore} allows to set maximum size for pagemap 
file and maximum size for session.
  * If the maximum size for session is exceeded, the last recently used pagemap 
file is removed.
- * 
+ *
  * @author Matej Knopp
  */
 public class DiskPageStore extends AbstractPageStore implements 
ISerializationAwarePageStore
 {
        /**
         * Each PageMap is represented by this class.
-        * 
+        *
         * @author Matej Knopp
         */
        protected static class PageMapEntry implements Serializable
@@ -102,7 +102,7 @@
 
        /**
         * Represents a session,
-        * 
+        *
         * @author Matej Knopp
         */
        protected static class SessionEntry implements Serializable
@@ -154,7 +154,7 @@
                /**
                 * Returns a [EMAIL PROTECTED] PageMapEntry} for specified 
pagemap. If the create attribute is set and
                 * the pagemap does not exist, new [EMAIL PROTECTED] 
PageMapEntry} will be created.
-                * 
+                *
                 * @param pageMapName
                 * @param create
                 * @return
@@ -185,7 +185,7 @@
 
                /**
                 * Removes the pagemap entry and deletes the file.
-                * 
+                *
                 * @param entry
                 */
                private void removePageMapEntry(PageMapEntry entry)
@@ -196,7 +196,7 @@
 
                /**
                 * Removes the specified pagemap and deletes the file.
-                * 
+                *
                 * @param pageMapName
                 */
                public synchronized void removePageMap(String pageMapName)
@@ -210,7 +210,7 @@
 
                /**
                 * Saves the serialized page to appropriate pagemap file.
-                * 
+                *
                 * @param page
                 */
                public synchronized void savePage(SerializedPage page)
@@ -259,7 +259,7 @@
 
                /**
                 * Removes the page from pagemap file.
-                * 
+                *
                 * @param pageMapName
                 * @param pageId
                 */
@@ -274,7 +274,7 @@
 
                /**
                 * Loads the part of pagemap file specified by the given 
PageWindow.
-                * 
+                *
                 * @param window
                 * @param pageMapFileName
                 * @return
@@ -309,7 +309,7 @@
 
                /**
                 * Loads the specified page data.
-                * 
+                *
                 * @param pageMapName
                 * @param id
                 * @param versionNumber
@@ -351,7 +351,7 @@
 
                /**
                 * Returns true if the given page exists for specified pageMap
-                * 
+                *
                 * @param pageMapName
                 * @param pageId
                 * @param versionNumber
@@ -374,7 +374,7 @@
        /**
         * Returns the folder for the specified sessions. If the folder doesn't 
exist and the create
         * flag is set, the folder will be created.
-        * 
+        *
         * @param sessionId
         * @param create
         * @return
@@ -397,7 +397,7 @@
 
        /**
         * Utility method for creating a directory
-        * 
+        *
         * @param file
         */
        private void mkdirs(File file)
@@ -426,7 +426,7 @@
        /**
         * Returns the file name for specified pagemap. If the session folder 
(folder that contains the
         * file) does not exist and createSessionFolder is true, the folder 
will be created.
-        * 
+        *
         * @param sessionId
         * @param pageMapName
         * @param createSessionFolder
@@ -443,7 +443,7 @@
 
        /**
         * Return maximum pagemap file size (in bytes).
-        * 
+        *
         * @return
         */
        protected int getMaxSizePerPageMap()
@@ -456,7 +456,7 @@
        /**
         * Returns maximum size per session (in bytes). After the session 
exceeds this size, appropriate
         * number of last recently used pagemap files will be removed.
-        * 
+        *
         * @return
         */
        protected int getMaxSizePerSession()
@@ -470,7 +470,7 @@
 
        /**
         * Returns the "root" file store folder.
-        * 
+        *
         * @return
         */
        protected File getFileStoreFolder()
@@ -482,7 +482,7 @@
 
        /**
         * Creates a new [EMAIL PROTECTED] DiskPageStore} instance.
-        * 
+        *
         * @param fileStoreFolder
         *            folder in which the session folders containing pagemap 
files will be stored
         * @param maxSizePerPagemap
@@ -588,7 +588,7 @@
 
        /**
         * Creates a new [EMAIL PROTECTED] DiskPageStore} instance.
-        * 
+        *
         * @param maxSizePerPagemap
         *            the maximum size of pagemap file (in bytes)
         * @param maxSizePerSession
@@ -596,7 +596,7 @@
         * @param fileChannelPoolCapacity
         *            the maximum number of concurrently opened files (higher 
number improves
         *            performance under heavy load).
-        * 
+        *
         */
        public DiskPageStore(int maxSizePerPagemap, int maxSizePerSession, int 
fileChannelPoolCapacity)
        {
@@ -649,7 +649,7 @@
        /**
         * Returns the SessionEntry for session with given id. If the entry 
does not yet exist and the
         * createIfDoesNotExist attribute is set, new SessionEntry will be 
created.
-        * 
+        *
         * @param sessionId
         * @param createIfDoesNotExist
         * @return
@@ -720,7 +720,7 @@
 
        /**
         * Removes the page (or entire pagemap) from specified session.
-        * 
+        *
         * @param entry
         * @param pageMap
         * @param id
@@ -768,7 +768,7 @@
        /**
         * Stores the serialized pages. The storing is done either immediately 
(in synchronous mode) or
         * it's scheduled to be stored by the worker thread.
-        * 
+        *
         * @param sessionId
         * @param pages
         */
@@ -792,7 +792,7 @@
 
        /**
         * Hook for processing serialized pages (e.g. sending those across 
cluster)
-        * 
+        *
         * @param sessionId
         * @param pages
         */
@@ -821,7 +821,7 @@
         */
        public void unbind(String sessionId)
        {
-               SessionEntry entry = 
(SessionEntry)sessionIdToEntryMap.get(sessionId);
+               SessionEntry entry = 
(SessionEntry)sessionIdToEntryMap.remove(sessionId);
                if (entry != null)
                {
                        if (isSynchronous())
@@ -851,7 +851,7 @@
        /**
         * Returns the list of pages to be saved for the specified session id. 
If the list is not found,
         * new list is created.
-        * 
+        *
         * @param sessionId
         * @return
         */
@@ -875,7 +875,7 @@
 
        /**
         * Saves all entries from the specified list.
-        * 
+        *
         * @param sessionId
         * @param list
         */
@@ -903,7 +903,7 @@
 
        /**
         * Schedules the pages to be saved by the worker thread.
-        * 
+        *
         * @param sessionId
         * @param pages
         */
@@ -924,7 +924,7 @@
        /**
         * Worker thread that saves the serialized pages. Saving pages in the 
separate thread results in
         * smoother performance under load.
-        * 
+        *
         * @author Matej Knopp
         */
        private class PageSavingThread implements Runnable
@@ -1018,7 +1018,7 @@
        /**
         * Returns the amount time in milliseconds for the saving thread to 
sleep between checking
         * whether there are pending serialized pages to be saved.
-        * 
+        *
         * @return
         */
        protected int getSavingThreadSleepTime()
@@ -1029,7 +1029,7 @@
        /**
         * Returns whether the [EMAIL PROTECTED] DiskPageStore} should work in 
synchronous or asynchronous mode.
         * Asynchronous mode uses a worker thread to save pages, which results 
in smoother performance.
-        * 
+        *
         * @return
         */
        protected boolean isSynchronous()
@@ -1042,7 +1042,7 @@
        /**
         * Sets the number of last recently serialized pages kept in cache. The 
cache is used to aid
         * performance on session replication.
-        * 
+        *
         * @param lastRecentlySerializedPagesCacheSize
         */
        public void setLastRecentlySerializedPagesCacheSize(int 
lastRecentlySerializedPagesCacheSize)
@@ -1065,7 +1065,7 @@
         * Strips the actual serialized page data. This is used to store
         * [EMAIL PROTECTED] SerializedPageWithSession} instance in http 
session to reduce the memory consumption.
         * The data can be stripped because it's already stored on disk
-        * 
+        *
         * @param page
         * @return
         */
@@ -1116,7 +1116,7 @@
        /**
         * Loads the data stripped by
         * [EMAIL PROTECTED] 
#stripSerializedPage(org.apache.wicket.protocol.http.pagestore.DiskPageStore.SerializedPageWithSession)}.
-        * 
+        *
         * @param page
         * @return
         */


Reply via email to