You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by im...@apache.org on 2006/07/07 12:19:11 UTC

svn commit: r419859 - /myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationManager.java

Author: imario
Date: Fri Jul  7 03:19:10 2006
New Revision: 419859

URL: http://svn.apache.org/viewvc?rev=419859&view=rev
Log:
TOMAHAWK-524: make conversationManager serializable to work together with distributed sessions. The manager itself is not serializable, its just a hack to make tomcat happy when in distributed session mode

Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationManager.java

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationManager.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationManager.java?rev=419859&r1=419858&r2=419859&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationManager.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationManager.java Fri Jul  7 03:19:10 2006
@@ -18,6 +18,9 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectStreamException;
 
 import javax.faces.FacesException;
 import javax.faces.context.FacesContext;
@@ -34,7 +37,7 @@
  *
  * @author imario@apache.org
  */
-public class ConversationManager
+public class ConversationManager implements Serializable
 {
 	private final static Log log = LogFactory.getLog(ConversationManager.class);
 
@@ -495,5 +498,22 @@
 				}
 			}
 		}
+	}
+
+	private void writeObject(java.io.ObjectOutputStream out) throws IOException
+	{
+		// the conversation manager is not (yet) serializable, we just implement it
+		// to make it work with distributed sessions
+	}
+
+	private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
+	{
+		// nothing written, so nothing to read
+	}
+
+	private Object readResolve() throws ObjectStreamException
+	{
+		// do not return a real object, that way on first request a new conversation manager will be created
+		return null;
 	}
 }