[Jboss-cvs] JBossAS SVN: r56184 - branches/Branch_4_0/cluster/src/main/org/jboss/ha/hasessionstate/server
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Aug 23 12:45:42 EDT 2006
Author: bstansberry at jboss.com
Date: 2006-08-23 12:45:42 -0400 (Wed, 23 Aug 2006)
New Revision: 56184
Modified:
branches/Branch_4_0/cluster/src/main/org/jboss/ha/hasessionstate/server/PackagedSessionImpl.java
Log:
[JBAS-3545] Ensure modification timestamp is correct for replicated sessions
Modified: branches/Branch_4_0/cluster/src/main/org/jboss/ha/hasessionstate/server/PackagedSessionImpl.java
===================================================================
--- branches/Branch_4_0/cluster/src/main/org/jboss/ha/hasessionstate/server/PackagedSessionImpl.java 2006-08-23 15:55:48 UTC (rev 56183)
+++ branches/Branch_4_0/cluster/src/main/org/jboss/ha/hasessionstate/server/PackagedSessionImpl.java 2006-08-23 16:45:42 UTC (rev 56184)
@@ -22,6 +22,8 @@
package org.jboss.ha.hasessionstate.server;
import org.jboss.ha.hasessionstate.interfaces.PackagedSession;
+
+import java.io.IOException;
import java.io.Serializable;
/**
@@ -42,15 +44,19 @@
protected long versionId;
protected String owner;
protected Serializable key;
- protected transient long lastModificationTimeInVM = System.currentTimeMillis ();
+ protected transient long lastModificationTimeInVM;
- public PackagedSessionImpl () { }
+ public PackagedSessionImpl ()
+ {
+ this.lastModificationTimeInVM = System.currentTimeMillis ();
+ }
public PackagedSessionImpl (Serializable key, byte[] state, String owner)
{
this.key = key;
this.setState (state);
this.owner = owner;
+ this.lastModificationTimeInVM = System.currentTimeMillis ();
}
public byte[] getState ()
@@ -80,7 +86,8 @@
{
this.state = (byte[])clone.getState().clone();
this.versionId = clone.getVersion ();
- this.owner = clone.getOwner ();
+ this.owner = clone.getOwner ();
+ this.lastModificationTimeInVM = System.currentTimeMillis();
}
public String getOwner ()
@@ -100,4 +107,12 @@
{
return this.lastModificationTimeInVM;
}
+
+ // JBAS-3545 -- have to set the mod time after deserializing
+ private void readObject(java.io.ObjectInputStream in)
+ throws IOException, ClassNotFoundException
+ {
+ in.defaultReadObject();
+ this.lastModificationTimeInVM = System.currentTimeMillis();
+ }
}
More information about the jboss-cvs-commits
mailing list