org.crazycake.shiro.SessionInMemory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shiro-redis Show documentation
Show all versions of shiro-redis Show documentation
shiro only provide the support of ehcache and concurrentHashMap. Here is an implement of redis cache can be used by shiro. Hope it will help you!
package org.crazycake.shiro;
import org.apache.shiro.session.Session;
import java.util.Date;
/**
* Use ThreadLocal as a temporary storage of Session, so that shiro wouldn't keep read redis several times while a request coming.
*/
public class SessionInMemory {
private Session session;
private Date createTime;
public Session getSession() {
return session;
}
public void setSession(Session session) {
this.session = session;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy