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
SessionRepository
ApplicationEventPublisherAware
FindByIndexNameSessionRepository
-
Nested Class Summary
Modifier and TypeClassDescriptionfinal class
A custom implementation ofSession
that uses aMapSession
as the basis for its mapping. -
Field Summary
Modifier and TypeFieldDescriptionprotected final AbstractApplicationPublisherBridge
protected final SpringCache
protected Duration
protected org.springframework.session.FlushMode
protected org.springframework.session.IndexResolver<org.springframework.session.Session>
protected final BasicCache<String,
org.springframework.session.MapSession> protected org.springframework.session.SaveMode
Fields inherited from interface org.springframework.session.FindByIndexNameSessionRepository
PRINCIPAL_NAME_INDEX_NAME
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractInfinispanSessionRepository
(SpringCache cache, AbstractApplicationPublisherBridge eventsBridge) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
deleteById
(String id) void
destroy()
protected abstract void
removeFromCacheWithoutNotifications
(String originalId) void
void
setApplicationEventPublisher
(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) void
setDefaultMaxInactiveInterval
(Duration defaultMaxInactiveInterval) Set the maximum inactive interval in seconds between requests before newly created sessions will be invalidated.void
setFlushMode
(org.springframework.session.FlushMode flushMode) Sets the flush mode.void
setIndexResolver
(org.springframework.session.IndexResolver<org.springframework.session.Session> indexResolver) Set theIndexResolver
to use.void
setSaveMode
(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, wait
Methods 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:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
destroy
public void destroy()- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) - Specified by:
setApplicationEventPublisher
in 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 theIndexResolver
to 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:
createSession
in interfaceorg.springframework.session.SessionRepository<AbstractInfinispanSessionRepository.InfinispanSession>
-
save
- Specified by:
save
in interfaceorg.springframework.session.SessionRepository<AbstractInfinispanSessionRepository.InfinispanSession>
-
removeFromCacheWithoutNotifications
-
findById
- Specified by:
findById
in interfaceorg.springframework.session.SessionRepository<AbstractInfinispanSessionRepository.InfinispanSession>
-
deleteById
- Specified by:
deleteById
in interfaceorg.springframework.session.SessionRepository<AbstractInfinispanSessionRepository.InfinispanSession>
-