Class HAStoreBase
- java.lang.Object
-
- org.apache.catalina.session.StoreBase
-
- org.glassfish.web.ha.session.management.HAStoreBase
-
- Direct Known Subclasses:
ReplicationStore
public abstract class HAStoreBase extends StoreBase
- Author:
- Larry White, Rajiv Mordani
-
-
Field Summary
Fields Modifier and Type Field Description protected int
_debug
Controls the verbosity of the web container subsystem's debug messages.protected Level
_logLevel
The current level of logging verbosity for this object.protected String
applicationId
The application idprotected String
clusterId
The cluster idprotected JavaEEIOUtils
ioUtils
-
Fields inherited from class org.apache.catalina.session.StoreBase
debug, info, lifecycle, manager, 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
Constructors Constructor Description HAStoreBase(JavaEEIOUtils ioUtils)
Creates a new instance of HAStoreBase
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
debug(String message)
void
doRemove(String id)
Remove the Session with the specified session identifier from this Store, if present.String
getApplicationId()
byte[]
getByteArray(Session session)
Create serialized byte[] forobj
.protected byte[]
getByteArray(Session session, boolean compress)
Create an byte[] for the session that we can then pass to the HA Store.protected String
getClusterId()
Return the cluster id for this Storeprotected 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 subclassesvoid
remove(String id)
Remove the Session with the specified session identifier from this Store, if present.void
removeSynchronized(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
-
-
-
-
Field Detail
-
ioUtils
protected JavaEEIOUtils ioUtils
-
_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 Level _logLevel
The current level of logging verbosity for this object.
-
applicationId
protected String applicationId
The application id
-
clusterId
protected String clusterId
The cluster id
-
-
Constructor Detail
-
HAStoreBase
public HAStoreBase(JavaEEIOUtils ioUtils)
Creates a new instance of HAStoreBase
-
-
Method Detail
-
debug
protected void debug(String message)
-
setLogLevel
protected void setLogLevel()
Set _debug flag and _logLevel based on the log level.
-
getApplicationId
public String getApplicationId()
-
getClusterIdFromConfig
protected String getClusterIdFromConfig()
Return the cluster id for this Store as defined in server.xml.
-
getClusterId
protected String getClusterId()
Return the cluster id for this Store
-
getByteArray
public byte[] getByteArray(Session session) throws IOException
Create serialized byte[] forobj
.- Parameters:
session
- - serialize obj- Returns:
- byte[] containing serialized data stream for obj
- Throws:
IOException
-
getByteArray
protected byte[] getByteArray(Session session, boolean compress) throws IOException
Create an byte[] for the session that we can then pass to the HA Store.- Parameters:
session
- The session we are serializing- Throws:
IOException
-
remove
public void remove(String id) throws 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:
IOException
- if an input/output error occurs
-
doRemove
public void doRemove(String id) throws 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:
IOException
- if an input/output error occurs
-
removeSynchronized
public void removeSynchronized(String id) throws 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:
IOException
- if an input/output error occurs
-
getSize
public int getSize() throws IOException
return the size of the store cache will be over-ridden in subclasses- Throws:
IOException
- if an input/output error occurs
-
-