Class MemoryHttpSessionStore
- java.lang.Object
-
- net.officefloor.web.session.store.MemoryHttpSessionStore
-
- All Implemented Interfaces:
HttpSessionStore
public class MemoryHttpSessionStore extends java.lang.Object implements HttpSessionStore
HttpSessionStore
that contains state of theHttpSession
within memory.This is a very basic implementation that keeps all
HttpSession
instances in memory. Though this may provide a very fast solution it suffers from issues such as:OutOfMemoryError
if too many/largeHttpSession
instances- state is not shared with other JVMs (especially for clustered environments)
This is useful in light load testing environments (such as unit tests).
- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description MemoryHttpSessionStore(java.time.Clock clock, int maxIdleTime)
Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createHttpSession(CreateHttpSessionOperation operation)
Triggers creating new details for aHttpSession
.void
invalidateHttpSession(InvalidateHttpSessionOperation operation)
Triggers invalidating theHttpSession
.void
retrieveHttpSession(RetrieveHttpSessionOperation operation)
Triggers retrieving theHttpSession
details.void
storeHttpSession(StoreHttpSessionOperation operation)
Triggers storing theHttpSession
details.
-
-
-
Constructor Detail
-
MemoryHttpSessionStore
public MemoryHttpSessionStore(java.time.Clock clock, int maxIdleTime)
Initiate.- Parameters:
clock
-Clock
for determiningHttpSession
times.maxIdleTime
- Maximum idle time in seconds before expiring theHttpSession
.
-
-
Method Detail
-
createHttpSession
public void createHttpSession(CreateHttpSessionOperation operation)
Description copied from interface:HttpSessionStore
Triggers creating new details for aHttpSession
.- Specified by:
createHttpSession
in interfaceHttpSessionStore
- Parameters:
operation
- Operation to receive results of creation.
-
retrieveHttpSession
public void retrieveHttpSession(RetrieveHttpSessionOperation operation)
Description copied from interface:HttpSessionStore
Triggers retrieving theHttpSession
details.- Specified by:
retrieveHttpSession
in interfaceHttpSessionStore
- Parameters:
operation
- Operation to receive results of the retrieval.
-
storeHttpSession
public void storeHttpSession(StoreHttpSessionOperation operation)
Description copied from interface:HttpSessionStore
Triggers storing theHttpSession
details.- Specified by:
storeHttpSession
in interfaceHttpSessionStore
- Parameters:
operation
- Operations to receive the results of the storage.
-
invalidateHttpSession
public void invalidateHttpSession(InvalidateHttpSessionOperation operation)
Description copied from interface:HttpSessionStore
Triggers invalidating theHttpSession
.- Specified by:
invalidateHttpSession
in interfaceHttpSessionStore
- Parameters:
operation
- Operation to invalidate theHttpSession
.
-
-