You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by kn...@apache.org on 2007/09/13 18:50:41 UTC

svn commit: r575368 - in /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http: SecondLevelCacheSessionStore.java pagestore/DiskPageStore.java

Author: knopp
Date: Thu Sep 13 09:50:39 2007
New Revision: 575368

URL: http://svn.apache.org/viewvc?rev=575368&view=rev
Log:
Slightly better error reporting when serialization during replication fails

Modified:
    wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java
    wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/DiskPageStore.java

Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java?rev=575368&r1=575367&r2=575368&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java Thu Sep 13 09:50:39 2007
@@ -18,9 +18,7 @@
 
 import java.io.IOException;
 import java.io.Serializable;
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
 
 import org.apache.wicket.Application;
 import org.apache.wicket.Component;
@@ -29,6 +27,7 @@
 import org.apache.wicket.PageMap;
 import org.apache.wicket.Request;
 import org.apache.wicket.RequestCycle;
+import org.apache.wicket.WicketRuntimeException;
 import org.apache.wicket.protocol.http.pagestore.DiskPageStore;
 import org.apache.wicket.session.pagemap.IPageMapEntry;
 import org.apache.wicket.util.collections.IntHashMap;
@@ -186,8 +185,6 @@
 
 		private transient Page lastPage = null;
 
-		private final List pageVersions = new ArrayList();
-
 		// whether the last page instance should be serialized together with the
 		// pagemap
 		private final boolean serializeLastPage;
@@ -376,6 +373,7 @@
 
 		private void writeObject(java.io.ObjectOutputStream s) throws IOException
 		{
+
 			s.defaultWriteObject();
 
 			// if the pagestore is not clustered, we need to serialize the
@@ -390,7 +388,14 @@
 					page = ((ISerializationAwarePageStore)store).prepareForSerialization(lastPage);
 				}
 
-				s.writeObject(page);
+				try
+				{
+					s.writeObject(page);
+				}
+				catch (Exception e)
+				{
+					throw new WicketRuntimeException("Failed to serialize " + page.toString(), e);
+				}
 			}
 		}
 

Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/DiskPageStore.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/DiskPageStore.java?rev=575368&r1=575367&r2=575368&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/DiskPageStore.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/DiskPageStore.java Thu Sep 13 09:50:39 2007
@@ -995,6 +995,12 @@
 			this.pages = new ArrayList(pages);
 			this.page = new WeakReference(page);
 		}
+
+		public String toString()
+		{
+			return getClass().getSimpleName() + " [ pageId:" + pageId + ", pageMapName: " +
+					pageMapName + ", session: " + sessionId + "]";
+		}
 	};
 
 	/**