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

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

public abstract class HAStoreBase
extends StoreBase

Author:
Larry White, Rajiv Mordani

Field Summary
protected  int _debug
          Controls the verbosity of the web container subsystem's debug messages.
protected static java.util.logging.Logger _logger
          The logger to use for logging ALL web container related messages.
protected  java.util.logging.Level _logLevel
          The current level of logging verbosity for this object.
protected  java.lang.String applicationId
          The application id
protected  java.lang.String clusterId
          The cluster id
protected  JavaEEIOUtils ioUtils
           
protected  ServerConfigLookup 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
HAStoreBase(ServerConfigLookup serverConfigLookup, JavaEEIOUtils ioUtils)
          Creates a new instance of HAStoreBase
 
Method Summary
protected  void debug(java.lang.String message)
           
 void doRemove(java.lang.String id)
          Remove the Session with the specified session identifier from this Store, if present.
 java.lang.String getApplicationId()
           
 byte[] getByteArray(Session session)
          Create serialized byte[] for obj.
protected  byte[] getByteArray(Session session, boolean compress)
          Create an byte[] for the session that we can then pass to the HA Store.
protected  java.lang.String getClusterId()
          Return the cluster id for this Store
protected  java.lang.String getClusterIdFromConfig()
          Return the cluster id for this Store as defined in server.xml.
 int getSize()
          return the size of the store cache will be over-ridden in subclasses
 void remove(java.lang.String id)
          Remove the Session with the specified session identifier from this Store, if present.
 void removeSynchronized(java.lang.String id)
          Remove the Session with the specified session identifier from this Store, if present.
protected  void setLogLevel()
          Set _debug flag and _logLevel based on the log level.
 
Methods inherited from class org.apache.catalina.session.StoreBase
addLifecycleListener, addPropertyChangeListener, doProcessExpires, findLifecycleListeners, getDebug, getInfo, getManager, getStoreName, load, log, processExpires, readSession, removeFromStoreCache, removeLifecycleListener, removePropertyChangeListener, setDebug, setManager, start, stop, writeSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.catalina.Store
clear, keys, load, save
 

Field Detail

serverConfigLookup

protected ServerConfigLookup serverConfigLookup

ioUtils

protected JavaEEIOUtils ioUtils

_logger

protected static final java.util.logging.Logger _logger
The logger to use for logging ALL web container related messages.


_debug

protected int _debug
Controls the verbosity of the web container subsystem's debug messages. This value is non-zero only when the level is one of FINE, FINER or FINEST.


_logLevel

protected java.util.logging.Level _logLevel
The current level of logging verbosity for this object.


applicationId

protected java.lang.String applicationId
The application id


clusterId

protected java.lang.String clusterId
The cluster id

Constructor Detail

HAStoreBase

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

Method Detail

debug

protected void debug(java.lang.String message)

setLogLevel

protected void setLogLevel()
Set _debug flag and _logLevel based on the log level.


getApplicationId

public java.lang.String getApplicationId()

getClusterIdFromConfig

protected java.lang.String getClusterIdFromConfig()
Return the cluster id for this Store as defined in server.xml.


getClusterId

protected java.lang.String getClusterId()
Return the cluster id for this Store


getByteArray

public byte[] getByteArray(Session session)
                    throws java.io.IOException
Create serialized byte[] for obj.

Parameters:
session - - serialize obj
Returns:
byte[] containing serialized data stream for obj
Throws:
java.io.IOException

getByteArray

protected byte[] getByteArray(Session session,
                              boolean compress)
                       throws java.io.IOException
Create an byte[] for the session that we can then pass to the HA Store.

Parameters:
session - The session we are serializing
Throws:
java.io.IOException

remove

public void remove(java.lang.String id)
            throws java.io.IOException
Remove the Session with the specified session identifier from this Store, if present. If no such Session is present, this method takes no action.

Parameters:
id - Session identifier of the Session to be removed
Throws:
java.io.IOException - if an input/output error occurs

doRemove

public void doRemove(java.lang.String id)
              throws java.io.IOException
Remove the Session with the specified session identifier from this Store, if present. If no such Session is present, this method takes no action. (This is the non-synchronized version of remove called by a store element from the pool, not the singleton store which must use removeSynchronized

Parameters:
id - Session identifier of the Session to be removed
Throws:
java.io.IOException - if an input/output error occurs

removeSynchronized

public void removeSynchronized(java.lang.String id)
                        throws java.io.IOException
Remove the Session with the specified session identifier from this Store, if present. If no such Session is present, this method takes no action.

Parameters:
id - Session identifier of the Session to be removed
Throws:
java.io.IOException - if an input/output error occurs

getSize

public int getSize()
            throws java.io.IOException
return the size of the store cache will be over-ridden in subclasses

Throws:
java.io.IOException


Copyright © 2012 GlassFish Community. All Rights Reserved.