public class EhSessionStore extends Object implements Session.Store
Session.Store powered by an Ehcache. In order to use this store a session cache is required.
ehcache.cache.session {
timeToIdle = 30m
}
In this example cache will expire after 30 minutes of inactivity. But of course, you can do whatever you want/need.
rnd| Constructor and Description |
|---|
EhSessionStore(net.sf.ehcache.Ehcache cache) |
| Modifier and Type | Method and Description |
|---|---|
void |
create(Session session) |
void |
delete(String id)
Delete a session by ID.
|
Session |
get(Session.Builder builder)
Get a session by ID (if any).
|
void |
save(Session session)
Save/persist a session.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgenerateID@Inject
public EhSessionStore(@Named(value="session")
net.sf.ehcache.Ehcache cache) public Session get(Session.Builder builder)
Session.Store
get in interface Session.Store
builder - A session builder.
null.
public void save(Session session)
Session.Store
save in interface Session.Store
session - A session to be persisted.
public void create(Session session)
create in interface Session.Store
public void delete(String id)
Session.Store
delete in interface Session.Store
id - A session ID.
Copyright © 2019. All rights reserved.