You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2004/12/13 01:39:50 UTC

svn commit: r111680 - /lenya/trunk/src/java/org/apache/lenya/ac/Identity.java

Author: gregor
Date: Sun Dec 12 16:39:48 2004
New Revision: 111680

URL: http://svn.apache.org/viewcvs?view=rev&rev=111680
Log:
Made Identity serializable (forward-ported from 1.2 branch)
Modified:
   lenya/trunk/src/java/org/apache/lenya/ac/Identity.java

Modified: lenya/trunk/src/java/org/apache/lenya/ac/Identity.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/ac/Identity.java?view=diff&rev=111680&p1=lenya/trunk/src/java/org/apache/lenya/ac/Identity.java&r1=111679&p2=lenya/trunk/src/java/org/apache/lenya/ac/Identity.java&r2=111680
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/ac/Identity.java	(original)
+++ lenya/trunk/src/java/org/apache/lenya/ac/Identity.java	Sun Dec 12 16:39:48 2004
@@ -29,7 +29,7 @@
 /**
  * Identity object. Used to store the authenticated accreditables in the session.
  */
-public class Identity extends AbstractLogEnabled implements Identifiable {
+public class Identity extends AbstractLogEnabled implements Identifiable, java.io.Serializable {
     private Set identifiables = new HashSet();
 
     /**
@@ -43,6 +43,22 @@
      */
     public void initialize() {
         addIdentifiable(World.getInstance());
+    }
+
+    /**
+     * In the case of Tomcat the object will be serialized to TOMCAT/work/Standalone/localhost/lenya/SESSIONS.ser
+     */
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+        out.defaultWriteObject();
+        out.writeObject(identifiables);
+    }
+
+    /**
+     * In case of Tomcat the object will be restored from TOMCAT/work/Standalone/localhost/lenya/SESSIONS.ser
+     */
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+        in.defaultReadObject();
+        identifiables = (Set) in.readObject();
     }
 
     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org