Class ReplicationManagerBase<T extends org.glassfish.ha.store.api.Storeable>
- java.lang.Object
-
- org.apache.catalina.session.ManagerBase
-
- org.apache.catalina.session.PersistentManagerBase
-
- org.glassfish.web.ha.session.management.ReplicationManagerBase<T>
-
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,Lifecycle
,Manager
- Direct Known Subclasses:
ReplicationWebEventPersistentManager
public abstract class ReplicationManagerBase<T extends org.glassfish.ha.store.api.Storeable> extends PersistentManagerBase
- Author:
- Rajiv Mordani
-
-
Field Summary
Fields Modifier and Type Field Description protected Logger
_logger
protected org.glassfish.ha.store.api.BackingStore<String,T>
backingStore
protected boolean
disableJreplica
protected static String
name
protected boolean
relaxCacheVersionSemantics
protected SessionFactory
sessionFactory
-
Fields inherited from class org.apache.catalina.session.PersistentManagerBase
invalidatedSessions, lifecycle
-
Fields inherited from class org.apache.catalina.session.ManagerBase
container, debug, devRandomSource, distributable, domain, duplicates, entropy, expiredSessions, initialized, log, maxActive, maxActiveUpdateLock, maxInactiveInterval, oname, randomClass, randomIS, rb, rejectedSessions, sessionAverageAliveTime, sessionCounter, sessionIdLength, sessionLocker, sessionMaxAliveTime, sessions, support, uuidGenerator
-
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 ReplicationManagerBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
createBackingStore(String persistenceType, String storeName, Class<T> metadataClass, Map<String,Object> vendorMap)
Session
createEmptySession()
Get a session from the recycled ones or create a new empty one.Session
createNewSession()
void
doRemove(String id)
abstract void
doValveSave(Session session)
Session
findSession(String id, String version)
Finds and returns the session with the given id that also satisfies the given version requirement.org.glassfish.ha.store.api.BackingStore<String,T>
getBackingStore()
abstract String
getReplicaFromPredictor(String sessionId, String oldJreplicaValue)
boolean
isDisableJreplica()
boolean
isRelaxCacheVersionSemantics()
should relax cache version semantics be appliedboolean
isSessionVersioningSupported()
Returns true if this session manager supports session versioning, false otherwise.void
removeSessionFromManagerCache(Session session)
void
setBackingStore(org.glassfish.ha.store.api.BackingStore<String,T> backingStore)
void
setDisableJreplica(boolean disableJreplica)
void
setRelaxCacheVersionSemantics(boolean value)
set the relaxCacheVersionSemanticsvoid
setSessionFactory(SessionFactory sessionFactory)
-
Methods inherited from class org.apache.catalina.session.PersistentManagerBase
addLifecycleListener, addToInvalidatedSessions, backgroundProcess, clearStore, createSession, createSession, findLifecycleListeners, findSession, findSession, getInfo, getMaxActiveSessions, getMaxIdleBackup, getMaxIdleSwap, getMinIdleSwap, getName, getSaveOnRestart, getStore, isLoaded, isSessionIdValid, isStarted, load, processExpires, processInvalidatedSessions, processMaxActiveSwaps, processMaxIdleBackups, processMaxIdleSwaps, processPersistenceChecks, propertyChange, release, remove, remove, removeFromInvalidatedSessions, removeLifecycleListener, removeSuper, setContainer, setMaxActiveSessions, setMaxIdleBackup, setMaxIdleSwap, setMinIdleSwap, setSaveOnRestart, setStarted, setStore, start, stop, superFindSession, swapIn, swapIn, swapOut, unload, writeSession
-
Methods inherited from class org.apache.catalina.session.ManagerBase
add, addPropertyChangeListener, changeSessionId, checkSessionAttribute, clearSessions, destroy, expireSession, findSession, findSessions, generateSessionId, generateSessionId, getActiveSessions, getClassName, getContainer, getDebug, getDistributable, getDomain, getDuplicates, getEngine, getEntropy, getExpiredSessions, getJvmRoute, getLastAccessedTimeMillis, getMaxActive, getMaxInactiveInterval, getMaxInactiveIntervalSeconds, getNewSession, getObjectName, getRandom, getRandomBytes, getRandomClass, getRandomFile, getRejectedSessions, getSessionAttribute, getSessionAverageAliveTime, getSessionAverageAliveTimeSeconds, getSessionCount, getSessionCounter, getSessionIdLength, getSessionMaxAliveTime, getSessionMaxAliveTimeSeconds, getUuidGenerator, init, listSessionIds, lockSession, log, log, postRequestDispatcherProcess, preRequestDispatcherProcess, removePropertyChangeListener, resetRandom, setDebug, setDistributable, setDuplicates, setEntropy, setExpiredSessions, setMaxActive, setMaxInactiveInterval, setMaxInactiveIntervalSeconds, setRandomClass, setRandomFile, setRejectedSessions, setSessionAverageAliveTime, setSessionAverageAliveTimeSeconds, setSessionCount, setSessionCounter, setSessionIdLength, setSessionLocker, setSessionMaxAliveTime, setSessionMaxAliveTimeSeconds, setUuidGenerator, toCookie, unlockSession, update
-
-
-
-
Field Detail
-
backingStore
protected org.glassfish.ha.store.api.BackingStore<String,T extends org.glassfish.ha.store.api.Storeable> backingStore
-
sessionFactory
protected SessionFactory sessionFactory
-
name
protected static final String name
- See Also:
- Constant Field Values
-
_logger
protected Logger _logger
-
relaxCacheVersionSemantics
protected boolean relaxCacheVersionSemantics
-
disableJreplica
protected boolean disableJreplica
-
-
Method Detail
-
createBackingStore
public abstract void createBackingStore(String persistenceType, String storeName, Class<T> metadataClass, Map<String,Object> vendorMap)
-
createNewSession
public Session createNewSession()
-
createEmptySession
public Session createEmptySession()
Description copied from class:ManagerBase
Get a session from the recycled ones or create a new empty one. The PersistentManager manager does not need to create session data because it reads it from the Store.- Specified by:
createEmptySession
in interfaceManager
- Overrides:
createEmptySession
in classManagerBase
-
setSessionFactory
public void setSessionFactory(SessionFactory sessionFactory)
-
setBackingStore
public void setBackingStore(org.glassfish.ha.store.api.BackingStore<String,T> backingStore)
-
doRemove
public void doRemove(String id)
-
isSessionVersioningSupported
public boolean isSessionVersioningSupported()
Description copied from class:ManagerBase
Returns true if this session manager supports session versioning, false otherwise.- Specified by:
isSessionVersioningSupported
in interfaceManager
- Overrides:
isSessionVersioningSupported
in classManagerBase
- Returns:
- true if this session manager supports session versioning, false otherwise.
-
findSession
public Session findSession(String id, String version) throws IOException
Description copied from class:ManagerBase
Finds and returns the session with the given id that also satisfies the given version requirement. This overloaded version of findSession() will be invoked only if isSessionVersioningSupported() returns true. By default, this method delegates to the version of findSession() that does not take any session version number.- Specified by:
findSession
in interfaceManager
- Overrides:
findSession
in classManagerBase
- Parameters:
id
- The session id to matchversion
- The session version requirement to satisfy- Returns:
- The session that matches the given id and also satisfies the given version requirement, or null if no such session could be found by this session manager
- Throws:
IOException
- if an IO error occurred
-
isRelaxCacheVersionSemantics
public boolean isRelaxCacheVersionSemantics()
should relax cache version semantics be applied
-
setRelaxCacheVersionSemantics
public void setRelaxCacheVersionSemantics(boolean value)
set the relaxCacheVersionSemantics- Parameters:
value
-
-
removeSessionFromManagerCache
public void removeSessionFromManagerCache(Session session)
-
setDisableJreplica
public void setDisableJreplica(boolean disableJreplica)
-
isDisableJreplica
public boolean isDisableJreplica()
-
doValveSave
public abstract void doValveSave(Session session)
-
-