org.glassfish.web.ha.session.management
Class ReplicationAttributeStore

java.lang.Object
  extended by org.apache.catalina.session.StoreBase
      extended by org.glassfish.web.ha.session.management.HAStoreBase
          extended by org.glassfish.web.ha.session.management.ReplicationStore
              extended by org.glassfish.web.ha.session.management.ReplicationAttributeStore
All Implemented Interfaces:
Lifecycle, Store

public class ReplicationAttributeStore
extends ReplicationStore

Author:
Larry White, Rajiv Mordani

Field Summary
 
Fields inherited from class org.glassfish.web.ha.session.management.HAStoreBase
_debug, _logLevel, applicationId, clusterId, ioUtils, serverConfigLookup
 
Fields inherited from class org.apache.catalina.session.StoreBase
debug, info, lifecycle, manager, sm, started, storeName, support
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
ReplicationAttributeStore(ServerConfigLookup serverConfigLookup, JavaEEIOUtils ioUtils)
          Creates a new instance of ReplicationAttributeStore
 
Method Summary
 void doSave(Session session)
          Save the specified Session into this Store.
 void doValveSave(Session session)
          Save the specified Session into this Store.
protected  java.lang.Object getAttributeValue(byte[] state)
          Given a byte[] containing session data, return a session object
protected  java.lang.Object getAttributeValueCollection(byte[] state)
          Given a byte[] containing session data, return a session object
protected  byte[] getByteArray(java.lang.Object attributeValue)
          Create an byte[] for the session that we can then pass to the HA Store.
protected  byte[] getByteArrayFromCollection(java.util.Collection entries)
          Create an byte[] for the session that we can then pass to the HA Store.
 Session getSession(CompositeMetadata metadata)
           
 Session load(java.lang.String id)
          Load and return the Session associated with the specified session identifier from this Store, without removing it.
 Session load(java.lang.String id, java.lang.String version)
           
protected  void loadAttributes(ModifiedAttributeHASession modifiedAttributeSession, java.util.Collection attributeList)
          Given a session, load its attributes
 void save(Session session)
          Save the specified Session into this Store.
 void valveSave(Session session)
          Save the specified Session into this Store.
 
Methods inherited from class org.glassfish.web.ha.session.management.ReplicationStore
clear, doRemove, getApplicationId, getSession, getSize, isReplicationCompressionEnabled, keys, loadFromBackingStore, processExpires, removeExpiredSessions, removeSynchronized, stop, updateLastAccessTime
 
Methods inherited from class org.glassfish.web.ha.session.management.HAStoreBase
debug, getByteArray, getByteArray, getClusterId, getClusterIdFromConfig, remove, setLogLevel
 
Methods inherited from class org.apache.catalina.session.StoreBase
addLifecycleListener, addPropertyChangeListener, doProcessExpires, findLifecycleListeners, getDebug, getInfo, getManager, getStoreName, log, readSession, removeFromStoreCache, removeLifecycleListener, removePropertyChangeListener, setDebug, setManager, start, writeSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationAttributeStore

public ReplicationAttributeStore(ServerConfigLookup serverConfigLookup,
                                 JavaEEIOUtils ioUtils)
Creates a new instance of ReplicationAttributeStore

Method Detail

valveSave

public void valveSave(Session session)
               throws java.io.IOException
Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.

Overrides:
valveSave in class ReplicationStore
Parameters:
session - Session to be saved
Throws:
java.io.IOException - if an input/output error occurs

save

public void save(Session session)
          throws java.io.IOException
Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.

Specified by:
save in interface Store
Overrides:
save in class ReplicationStore
Parameters:
session - Session to be saved
Throws:
java.io.IOException - if an input/output error occurs

doValveSave

public void doValveSave(Session session)
                 throws java.io.IOException
Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.

Overrides:
doValveSave in class ReplicationStore
Parameters:
session - Session to be saved
Throws:
java.io.IOException - if an input/output error occurs

doSave

public void doSave(Session session)
            throws java.io.IOException
Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.

Overrides:
doSave in class ReplicationStore
Parameters:
session - Session to be saved
Throws:
java.io.IOException - if an input/output error occurs

load

public Session load(java.lang.String id)
             throws java.lang.ClassNotFoundException,
                    java.io.IOException
Load and return the Session associated with the specified session identifier from this Store, without removing it. If there is no such stored Session, return null.

Specified by:
load in interface Store
Overrides:
load in class ReplicationStore
Parameters:
id - Session identifier of the session to load
Throws:
java.lang.ClassNotFoundException - if a deserialization error occurs
java.io.IOException - if an input/output error occurs

load

public Session load(java.lang.String id,
                    java.lang.String version)
             throws java.lang.ClassNotFoundException,
                    java.io.IOException
Overrides:
load in class ReplicationStore
Throws:
java.lang.ClassNotFoundException
java.io.IOException

getSession

public Session getSession(CompositeMetadata metadata)
                   throws java.io.IOException
Throws:
java.io.IOException

getByteArray

protected byte[] getByteArray(java.lang.Object attributeValue)
                       throws java.io.IOException
Create an byte[] for the session that we can then pass to the HA Store.

Parameters:
attributeValue - The attribute value we are serializing
Throws:
java.io.IOException

getAttributeValue

protected java.lang.Object getAttributeValue(byte[] state)
                                      throws java.io.IOException,
                                             java.lang.ClassNotFoundException
Given a byte[] containing session data, return a session object

Parameters:
state - The byte[] with the session attribute data
Returns:
A newly created object for the given session attribute data
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getByteArrayFromCollection

protected byte[] getByteArrayFromCollection(java.util.Collection entries)
                                     throws java.io.IOException
Create an byte[] for the session that we can then pass to the HA Store.

Parameters:
entries - The Collection of entries we are serializing
Throws:
java.io.IOException

getAttributeValueCollection

protected java.lang.Object getAttributeValueCollection(byte[] state)
                                                throws java.io.IOException,
                                                       java.lang.ClassNotFoundException
Given a byte[] containing session data, return a session object

Parameters:
state - The byte[] with the session attribute data
Returns:
A newly created object for the given session attribute data
Throws:
java.io.IOException
java.lang.ClassNotFoundException

loadAttributes

protected void loadAttributes(ModifiedAttributeHASession modifiedAttributeSession,
                              java.util.Collection attributeList)
Given a session, load its attributes

Parameters:
modifiedAttributeSession - The session (header info only) having its attributes loaded
attributeList - The List list of loaded attributes


Copyright © 2012 GlassFish Community. All Rights Reserved.