Class AbstractInfinispanSessionRepository
java.lang.Object
org.infinispan.spring.common.session.AbstractInfinispanSessionRepository
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationEventPublisherAware,org.springframework.session.FindByIndexNameSessionRepository<AbstractInfinispanSessionRepository.InfinispanSession>,org.springframework.session.SessionRepository<AbstractInfinispanSessionRepository.InfinispanSession>
- Direct Known Subclasses:
InfinispanEmbeddedSessionRepository,InfinispanRemoteSessionRepository
public abstract class AbstractInfinispanSessionRepository
extends Object
implements org.springframework.session.FindByIndexNameSessionRepository<AbstractInfinispanSessionRepository.InfinispanSession>, org.springframework.context.ApplicationEventPublisherAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Infinispan implementation for Spring Session with basic functionality.
- Since:
- 9.0
- Author:
- Sebastian Ćaskawiec
- See Also:
-
- Spring Session Web Page
SessionRepositoryApplicationEventPublisherAwareFindByIndexNameSessionRepository
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classA custom implementation ofSessionthat uses aMapSessionas the basis for its mapping. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AbstractApplicationPublisherBridgeprotected final SpringCacheprotected Durationprotected org.springframework.session.FlushModeprotected org.springframework.session.IndexResolver<org.springframework.session.Session>protected final BasicCache<String,org.springframework.session.MapSession> protected org.springframework.session.SaveModeFields inherited from interface org.springframework.session.FindByIndexNameSessionRepository
PRINCIPAL_NAME_INDEX_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractInfinispanSessionRepository(SpringCache cache, AbstractApplicationPublisherBridge eventsBridge) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddeleteById(String id) voiddestroy()protected abstract voidremoveFromCacheWithoutNotifications(String originalId) voidvoidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) voidsetDefaultMaxInactiveInterval(Duration defaultMaxInactiveInterval) Set the maximum inactive interval in seconds between requests before newly created sessions will be invalidated.voidsetFlushMode(org.springframework.session.FlushMode flushMode) Sets the flush mode.voidsetIndexResolver(org.springframework.session.IndexResolver<org.springframework.session.Session> indexResolver) Set theIndexResolverto use.voidsetSaveMode(org.springframework.session.SaveMode saveMode) Set the save mode.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.session.FindByIndexNameSessionRepository
findByIndexNameAndIndexValue, findByPrincipalName
-
Field Details
-
applicationEventPublisher
-
cache
-
nativeCache
-
defaultMaxInactiveInterval
-
flushMode
protected org.springframework.session.FlushMode flushMode -
saveMode
protected org.springframework.session.SaveMode saveMode -
indexResolver
protected org.springframework.session.IndexResolver<org.springframework.session.Session> indexResolver
-
-
Constructor Details
-
AbstractInfinispanSessionRepository
protected AbstractInfinispanSessionRepository(SpringCache cache, AbstractApplicationPublisherBridge eventsBridge)
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) - Specified by:
setApplicationEventPublisherin interfaceorg.springframework.context.ApplicationEventPublisherAware
-
setDefaultMaxInactiveInterval
Set the maximum inactive interval in seconds between requests before newly created sessions will be invalidated. A negative time indicates that the session will never time out. The default is 30 minutes.- Parameters:
defaultMaxInactiveInterval- the default maxInactiveInterval
-
setIndexResolver
public void setIndexResolver(org.springframework.session.IndexResolver<org.springframework.session.Session> indexResolver) Set theIndexResolverto use.- Parameters:
indexResolver- the index resolver
-
setFlushMode
public void setFlushMode(org.springframework.session.FlushMode flushMode) Sets the flush mode. Default flush mode isFlushMode.ON_SAVE.- Parameters:
flushMode- the new Hazelcast flush mode
-
setSaveMode
public void setSaveMode(org.springframework.session.SaveMode saveMode) Set the save mode. Default save mode isSaveMode.ON_SET_ATTRIBUTE.- Parameters:
saveMode- the save mode
-
createSession
- Specified by:
createSessionin interfaceorg.springframework.session.SessionRepository<AbstractInfinispanSessionRepository.InfinispanSession>
-
save
- Specified by:
savein interfaceorg.springframework.session.SessionRepository<AbstractInfinispanSessionRepository.InfinispanSession>
-
removeFromCacheWithoutNotifications
-
findById
- Specified by:
findByIdin interfaceorg.springframework.session.SessionRepository<AbstractInfinispanSessionRepository.InfinispanSession>
-
deleteById
- Specified by:
deleteByIdin interfaceorg.springframework.session.SessionRepository<AbstractInfinispanSessionRepository.InfinispanSession>
-