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_loggerprotected org.glassfish.ha.store.api.BackingStore<String,T>backingStoreprotected booleandisableJreplicaprotected static Stringnameprotected booleanrelaxCacheVersionSemanticsprotected SessionFactorysessionFactory-
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 voidcreateBackingStore(String persistenceType, String storeName, Class<T> metadataClass, Map<String,Object> vendorMap)SessioncreateEmptySession()Get a session from the recycled ones or create a new empty one.SessioncreateNewSession()voiddoRemove(String id)abstract voiddoValveSave(Session session)SessionfindSession(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 StringgetReplicaFromPredictor(String sessionId, String oldJreplicaValue)booleanisDisableJreplica()booleanisRelaxCacheVersionSemantics()should relax cache version semantics be appliedbooleanisSessionVersioningSupported()Returns true if this session manager supports session versioning, false otherwise.voidremoveSessionFromManagerCache(Session session)voidsetBackingStore(org.glassfish.ha.store.api.BackingStore<String,T> backingStore)voidsetDisableJreplica(boolean disableJreplica)voidsetRelaxCacheVersionSemantics(boolean value)set the relaxCacheVersionSemanticsvoidsetSessionFactory(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:ManagerBaseGet 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:
createEmptySessionin interfaceManager- Overrides:
createEmptySessionin 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:ManagerBaseReturns true if this session manager supports session versioning, false otherwise.- Specified by:
isSessionVersioningSupportedin interfaceManager- Overrides:
isSessionVersioningSupportedin 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:ManagerBaseFinds 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:
findSessionin interfaceManager- Overrides:
findSessionin 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)
-
-