FileDocCategorySizeDatePackage
PackagedSessionImpl.javaAPI DocJBoss 4.2.13524Fri Jul 13 20:52:38 BST 2007org.jboss.ha.hasessionstate.server

PackagedSessionImpl

public class PackagedSessionImpl extends Object implements org.jboss.ha.hasessionstate.interfaces.PackagedSession
Default implementation of PackagedSession
see
PackagedSession, HASessionStateImpl
author
sacha.labourey@cogito-info.ch
version
$Revision: 57188 $

Fields Summary
private static final long
serialVersionUID
The serialVersionUID
protected byte[]
state
protected long
versionId
protected String
owner
protected Serializable
key
protected transient long
lastModificationTimeInVM
Constructors Summary
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 ();
   
Methods Summary
public java.io.SerializablegetKey()

 return this.key; 
public java.lang.StringgetOwner()

 return this.owner; 
public byte[]getState()

      return this.state;
   
public longgetVersion()

 return this.versionId; 
public booleanisStateIdentical(byte[] state)

      return java.util.Arrays.equals (state, this.state);
   
private voidreadObject(java.io.ObjectInputStream in)

      in.defaultReadObject();
      this.lastModificationTimeInVM = System.currentTimeMillis();
   
public voidsetKey(java.io.Serializable key)

 this.key = key; 
public voidsetOwner(java.lang.String owner)

 this.owner = owner; 
public booleansetState(byte[] state)

      this.lastModificationTimeInVM = System.currentTimeMillis ();
      if (isStateIdentical (state))
         return true;
      else
      {
         this.state = state;
         this.versionId++;
         return false;
      }
   
public longunmodifiedExistenceInVM()

      return this.lastModificationTimeInVM;
   
public voidupdate(org.jboss.ha.hasessionstate.interfaces.PackagedSession clone)

      this.state = (byte[])clone.getState().clone();
      this.versionId = clone.getVersion ();
      this.owner = clone.getOwner ();    
      this.lastModificationTimeInVM = System.currentTimeMillis();