getactive控件中调用dllsessions 什么时候调用

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
您的访问请求被拒绝 403 Forbidden - ITeye技术社区
您的访问请求被拒绝
亲爱的会员,您的IP地址所在网段被ITeye拒绝服务,这可能是以下两种情况导致:
一、您所在的网段内有网络爬虫大量抓取ITeye网页,为保证其他人流畅的访问ITeye,该网段被ITeye拒绝
二、您通过某个代理服务器访问ITeye网站,该代理服务器被网络爬虫利用,大量抓取ITeye网页
请您点击按钮解除封锁&2715人阅读
Java(56)
shiro提供了一个完整的企业级会话管理解决方案,不再依赖web容器。可以在web和非web环境下使用。
shiro的session特性
基于POJO/J2SE:shiro中session相关的类都是基于接口实现的简单的java对象(POJO),兼容所有java对象的配置方式,扩展也更方便,完全可以定制自己的会话管理功能
简单灵活的会话存储/持久化:因为shiro中的session对象是基于简单的java对象的,所以你可以将session存储在任何地方,例如,文件,各种数据库,内存中等。
容器无关的集群功能:shiro中的session可以很容易的集成第三方的缓存产品完成集群的功能。例如,Ehcache
&#43; Terracotta, Coherence, GigaSpaces等。你可以很容易的实现会话集群而无需关注底层的容器实现。
异构客户端的访问:可以实现web中的session和非web项目中的session共享。
会话事件监听:提供对对session整个生命周期的监听。
保存主机地址:在会话开始session会存用户的ip地址和主机名,以此可以判断用户的位置。
会话失效/过期的支持:用户长时间处于不活跃状态可以使会话过期,调用touch()方法,可以主动更新最后访问时间,让会话处于活跃状态。
透明的Web支持:shiro全面支持Servlet
2.5中的session规范。这意味着你可以将你现有的web程序改为shiro会话,而无需修改代码。
单点登录的支持:shiro
session基于普通java对象,使得它更容易存储和共享,可以实现跨应用程序共享。可以根据共享的会话,来保证认证状态到另一个程序。从而实现单点登录。
可以从当前的Subject中获取会话。
&获取session的subject.getSession()方法等价于currentUser.getSubject(true)。
Suject.getSession(boolean create) 与web中的 HttpServletRequest.getSession(boolean create) 类&#20284;。
如果Subject已经拥有一个session,则方法中的boolean类型参数将会忽略,并直接返回已经存在的session。
如果Subject里没有拥有session,如果参数为true,则创建一个新的session并返回。
如果Subject里没有拥有session,如果参数为false,则不会创建新的session,并返回null。
返回&#20540;
getAttribute(Object key)&
根据key标识返回绑定到session的对象
Collection&Object&
getAttributeKeys()&
获取在session中存储的所有的key
获取当前主机ip地址,如果未知,返回null
Serializable
获取session的唯一id
getLastAccessTime()&
获取最后的访问时间
getStartTimestamp()&
获取session的启动时间
getTimeout()&
获取session失效时间,单位毫秒
setTimeout(long maxIdleTimeInMillis)&
设置session的失效时间
removeAttribute(Object key)&
通过key移除session中绑定的对象
setAttribute(Object key, Object value)&
设置session会话属性
更新会话最后访问时间
会话管理器
SessionManager管理所有Subject的session包括创建、维护、删除、失效、验证等工作。SessionManager是顶层组件,由SecurityManager管理。
SecurityManager的实现类DefaultSecurityManager及DefaultWebSecurityManager继承了SessionsSecurityManager。
SessionsSecurityManager可以把相应的会话管理委托给SessionManager。
例如SessionsSecurityManager中的代码
SecurityManager相关的类。
非web相关的
shiro session
web session
shiro提供了三个SessionManager的实现
DefaultSessionManager:DefaultSecurityManager使用的默认实现,用于非web环境。
ServletContainerSessionManager:DefaultWebSecurityManager使用的默认实现,用于Web环境,其直接使用Servlet容器的会话。
DefaultWebSessionManager:用于Web环境的实现,可以替代ServletContainerSessionManager自己维护着会话,容器无关。
像SecurityManager其它组件一样,可以使用getter/setter方法获取和设置组件,同时也支持ini配置。
会话失效时间
全局会话失效时间
也可以为每个session单独设置会话失效时间
调用session的setTimeout(long maxIdleTimeInMillis) ,参数为毫秒
对于ServletContainerSessionManager,由于依赖于具体容器,所有失效时间要在容器里设置。
DefaultWebSessionManager容器无关的SessionMannager
sessionIdCookie是sessionManager创建会话Cookie的模板。
sessionIdCookie.name:设置Cookie名字,默认为JSESSIONID;
sessionIdCookie.domain:设置Cookie的域名,默认空,即当前访问的域名;
sessionIdCookie.path:设置Cookie的路径,默认空,即存储在域名根下;
sessionIdCookie.maxAge:设置Cookie的过期时间,秒为单位,默认-1表示关闭浏览器时过期Cookie;
sessionIdCookie.httpOnly:如果设置为true,更安全, 防止 XSS 攻击
sessionManager.sessionIdCookieEnabled:是否启用/禁用Session Id Cookie,默认是启用的;如果禁用后将不会设置Session Id Cookie,即默认使用了Servlet容器的JSESSIONID,且通过URL重写(URL中的“;JSESSIONID=id”部分)保存Session
要写自己的监听器,需要实现 SessionListener&&接口
注:session监听是对所有的session监听,而不是针对某个特殊的session
会话存储/持久化
Session可以存储在内存或者各种数据库中。SessionManager委托SeesionDao对session进行增删改查。
你可以为SessionManager配置SessionDao
如果使用的是ServletContainerSessionManager,由于它是容器相关的,session也是有对应的容器管理的,无法使用SessionDao。
对于web项目可以使用DefaultWebSessionManager。
EHCache SessionDAO
EHCache SessionDAO存储Session到内存,如果内存不够用的话,会保存到磁盘。Ehcache配合TerraCotta可以实现容器无关的分布式集群。
启用ehcache支持,在pom.xml中添加
为shiro所有用到缓存的地方,都配置成ehcache,自然SessionDao,也会被配置为EHCache来保存session。
sessionDAO.activeSessionsCacheName:设置Session缓存名字,默认就是shiro-activeSessionCache。
cacheManager:缓存管理器,用于管理缓存的,这里使用Ehcache实现。
cacheManager.cacheManagerConfigFile:设置ehcache缓存的配置文件,默认文件位置在shiro-ehcache包中。
securityManager.cacheManager:设置SecurityManager的cacheManager,会自动设置实现了CacheManagerAware接口的相应对象,如SessionDAO的cacheManager。
EHCache的配置,默认在shiro-ehcache包中
其中,name属性必须与上边ini配置中activeSessionsCacheNamename一致。
如果要自己配置的话有两点很重要。
overflowToDisk=”true” :设置为true,表示如果内存不够用了,会将会话保存到硬盘。
eternal=”true” :设置为true,表示会话对象的缓存不会被自动设置为过期或删除。shiro的session检查机制是基于调度器定时检测的,如果自动删除或者设置过期的话,shiro是无法知道session是否过期的,这样就会出现问题,所以要设置为true。
Session ID生成器
在每次创建session时,SessionDAO都会使用&SessionIdGenerator生成一个新的session ID,&SessionIdGenerator默认实现是JavaUuidSessionIdGenerator,也就是生成UUID。
可以自定义自己的SessionIdGenerator。
ini配置如下
SessionDao的相关类
session dao
SessionDao接口定义了以下方法。
AbstractSessionDAO提供了SessionDAO的一些实现,例如生成会话id,创建会话。
CachingSessionDAO提供了会话缓存的管理功能,需要为其设置CacheManager。
MemorySessionDAO基于内存的,会话持久化实现。
EnterpriseCacheSessionDAO继承MemorySessionDAO,并为其提供了一个MapCache作为简单的缓存管理器。在生产环境中如果直接使用EnterpriseCacheSessionDAO,推荐为其设置CacheManager,例如基于EHCache的EhCacheManager
,因为MapCache容易出现内存溢出,因为它无法持久化数据到硬盘。
自定义SessionDao继承CachingSessionDAO即可,例如实现把会话保存到数据库,同时要为SessionDao设置CacheManager,这样在获取session的时候会先从缓存获取,获取不到的时候才会查询数据库。
Session必须通过验证才可以将无效过过期的session删除,出于性能的考虑,只有在获取会话的时候去验证会话是否过期。如果用户不主动退出,是无法知道session是否失效或过期的。如果不定期清理,session会越来越多。因此需要定期清理,shiro提供了会话验证调度器&SessionValidationScheduler来定期完成清除session的工作。
默认的调度器
默认的&SessionValidationScheduler调度器实现是&ExecutorServiceSessionValidationScheduler (基于JDKScheduledExecutorService实现的)。默认的调度周期是1小时,也就是没小时都会执行一次session验证,并清除过期或无效的session。
关闭调度器(默认是开启)
关闭无效session的删除(默认是开启)
在web应用中,如果是在获取会话时验证了会话已过期,将抛出InvalidSessionException;因此需要捕获这个异常并跳转到相应的页面告诉用户会话已过期,让其重新登录,如可以在web.xml配置相应的错误页面:
对于shiro实现集群功能,后续文章会介绍。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:368702次
积分:4983
积分:4983
排名:第3729名
原创:122篇
转载:184篇
评论:33条
(4)(2)(9)(3)(17)(1)(4)(3)(4)(5)(6)(7)(9)(1)(13)(4)(13)(4)(2)(4)(2)(18)(16)(8)(4)(5)(6)(6)(11)(17)(8)(1)(4)(1)(5)(14)(10)(6)(4)(5)(7)(17)(4)(1)(8)(2)(4)Shiro源码分析之两种Session的方式
、默认的处理方式
&!-- 定义 Shiro 主要业务对象 --&
&bean id=&securityManager& class=&org.apache.shiro.web.mgt.DefaultWebSecurityManager&&
&!-- &property name=&sessionManager& ref=&sessionManager& /& --&
&property name=&realm& ref=&systemAuthorizingRealm& /&
&property name=&cacheManager& ref=&shiroCacheManager& /&
这里从这里看起,这个代码是定义的安全管理对象,看下面的构造方法(代码 )
public DefaultWebSecurityManager() {
((DefaultSubjectDAO) this.subjectDAO).setSessionStorageEvaluator(new DefaultWebSessionStorageEvaluator());
this.sessionMode = HTTP_SESSION_MODE;
setSubjectFactory(new DefaultWebSubjectFactory());
setRememberMeManager(new CookieRememberMeManager());
setSessionManager(new ServletContainerSessionManager());
从 构造方法里面可以看出,这里面有 和 两个方法。这两个分别是对的功能和功能的管理。其中在构造方法里面可以看到,其实一开是就设置了,就是默认的:接下来看看默认的是怎么玩转的看下图。这个图显示了这个类的这些个方法
这个类通过获得,下面看看这个方法干了些什么(代码)
(代码1-2)
if (!WebUtils.isHttp(key)) { //判断是不是http的key,否则抛异常
String msg = &SessionKey must be an HTTP compatible implementation.&;
throw new IllegalArgumentException(msg);
HttpServletRequest request = WebUtils.getHttpRequest(key); //通过工具类获得HttpServletRequest 这类是javax.servlet.http.HttpServletR
Session session =
HttpSession httpSession = request.getSession(false);//先从request里获得本来存在的
if (httpSession != null) {
session = createSession(httpSession, request.getRemoteHost());//如果不为空,就创建一个封装了的,为空就不管它
可以看看注释,注释上都写好了,这里的意思是,首先判断封装好的是不是的,如果是就继续,不是就抛异常这个是带了和的,具体怎么出来的,看的这方法代码就知道了(代码),这里里,将和还有传递进去
protected SessionKey getSessionKey(SubjectContext context) {
if (WebUtils.isWeb(context)) {
Serializable sessionId = context.getSessionId();
ServletRequest request = WebUtils.getRequest(context);
ServletResponse response = WebUtils.getResponse(context);
return new WebSessionKey(sessionId, request, response);
return super.getSessionKey(context);
因为继承了 这个类是实现了这个接口。
看看createSession这个方法,这个方法就是将传入的HttpSession和host传进去,封装成Shiro的HttpServletSession (代码 1-4)
return new HttpServletSession(httpSession, host);
关于默认的管理器,最后还看一下这个类,就看一下的几个方法,还有些方法是没有放出来的,可以明显的看出,使用了一个叫的接口,但这个接口是和的接口一模一样,就是通过这个接口获得的功能(代码)
public class HttpServletSession implements Session {
private HttpSession httpSession =
public HttpServletSession(HttpSession httpSession, String host) {
if (httpSession == null) {
String msg = &HttpSession constructor argument cannot be null.&;
throw new IllegalArgumentException(msg);
if (httpSession instanceof ShiroHttpSession) {
String msg = &HttpSession constructor argument cannot be an instance of ShiroHttpSession.
&is enforced to prevent circular dependencies and infinite loops.&;
throw new IllegalArgumentException(msg);
this.httpSession = httpS
if (StringUtils.hasText(host)) {
setHost(host);
public Object getAttribute(Object key) throws InvalidSessionException {
return httpSession.getAttribute(assertString(key));
} catch (Exception e) {
throw new InvalidSessionException(e);
public void setAttribute(Object key, Object value) throws InvalidSessionException {
httpSession.setAttribute(assertString(key), value);
} catch (Exception e) {
throw new InvalidSessionException(e);
默认的模式就描述到这里
、接下来说第二种方式,就是废弃掉自己的,使用企业级方案,这种方案可以和容器无关,但在我们项目没有使用,因为用了开源连接池貌似的时候有点不对。
&bean id=&sessionManager& class=&org.apache.shiro.web.session.mgt.DefaultWebSessionManager&&
&property name=&globalSessionTimeout& value=&3600000& /&
&property name=&sessionDAO& ref=&sessionDAO& /&
&bean id=&sessionDAO& class=&org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO&&
&property name=&activeSessionsCacheName& value=&shiro-activeSessionCache& /&
&property name=&cacheManager& ref=&shiroCacheManager& /&
&!-- 用户授权信息Cache, 采用EhCache --&
&bean id=&shiroCacheManager& class=&org.apache.shiro.cache.ehcache.EhCacheManager&&
&property name=&cacheManager& ref=&cacheManager&/&
必须向注册然后将注入进去
这种配置的创建入口在;这里看下面代码(代码)
if (log.isTraceEnabled()) {
log.trace(&attem create = & + create +
&; session is null = & + (this.session == null) +
&; session has id = & + (this.session != null && session.getId() != null));
if (this.session == null && create) {//session为空,并且能创建
SessionContext sessionContext = createSessionContext();
Session session = this.securityManager.start(sessionContext);//在这里创建Session
this.session = decorate(session);//包装Session,他自己建的自己也去包装一下
调用的父类的,下面是这个方法的代码(代码)
public Session start(SessionContext context) throws AuthorizationException {
return this.sessionManager.start(context);
然后调用的方法来创建。创建的入口,就在这里。看下面代码分析(代码)
Session session = createSession(context);//创建Session
applyGlobalSessionTimeout(session);
onStart(session, context);
notifyStart(session);
return createExposedSession(session, context);
创建这里是调用的父类的,其实父类也没有真正来创建。这里用到了模板方法,父类里面的是抽象方法,最后真正创建子类的还是交给子类去实现(代码)
enableSessionValidationIfNecessary();
return doCreateSession(context);
protected abstract Session doCreateSession(SessionContext initData) throws AuthorizationE
其他的也没多少可分析的。这里再看一下里面的工厂的方法(代码)
if (initData != null) {
String host = initData.getHost();
if (host != null) {
return new SimpleSession(host);
return new SimpleSession();
这里的是实现了接口的。具体可以看看相关的类继承图
另外是怎么缓存进入的呢?在下面的调用下面代码创建的过程中,以下方法会调用,而缓存就在这里面(代码)
protected Session doCreateSession(SessionContext context) {
Session s = newSessionInstance(context);
if (log.isTraceEnabled()) {
log.trace(&Creating session for host {}&, s.getHost());
create(s);
经过一些步骤之后在里被缓存,下面是代码。可以看下面的注释(代码)
if (session == null || sessionId == null) {
Cache&Serializable, Session& cache = getActiveSessionsCacheLazy();//获取缓存
if (cache == null) {
cache(session, sessionId, cache);//有缓存就存起来
以上是的创建过程,获取就简单说吧,有些过程自己发现更有趣。这里会调用的父类的这个方法(代码)
return lookupRequiredSession(sessionKey).getAttribute(attributeKey);
最后会调用的这个在这里就会从缓存里读取(代码)
(代码2-9)
public Session readSession(Serializable sessionId) throws UnknownSessionException {
Session s = getCachedSession(sessionId);
if (s == null) {
s = super.readSession(sessionId);
这是的代码。看了代码想必很容易理解了吧(代码)
protected Session getCachedSession(Serializable sessionId) {
Session cached =
if (sessionId != null) {
Cache&Serializable, Session& cache = getActiveSessionsCacheLazy();
if (cache != null) {
cached = getCachedSession(sessionId, cache);
获得了,要获得里面的值和对象就很容易了
有问题欢迎提出来,因为是先写在编辑器上的,然后在拷贝到上,所以代码是一致的黑色,希望能够讲究着看,写个原创文章不容易,眼睛都看肿了,所以转载的时候能带上作者,谢谢
作者:肖华
最新教程周点击榜
微信扫一扫CachingSessionDAO (Apache Shiro :: Core 1.2.0 API)
org.apache.shiro.session.mgt.eis
Class CachingSessionDAO
org.apache.shiro.session.mgt.eis.CachingSessionDAO
All Implemented Interfaces: ,
Direct Known Subclasses:
public abstract class CachingSessionDAOextends implements
An CachingSessionDAO is a SessionDAO that provides a transparent caching layer between the components that
use it and the underlying EIS (Enterprise Information System) session backing store (for example, filesystem,
database, enterprise grid/cloud, etc).
This implementation caches all active sessions in a configured
This property is null by default and if one is
not explicitly set, a
is expected to be configured which will in turn be used
to acquire the Cache instance to use for the activeSessionsCache.
All SessionDAO methods are implemented by this class to employ
caching behavior and delegates the actual EIS operations to respective do* methods to be implemented by
subclasses (doCreate, doRead, etc).
&&&&&&&&&&The default active sessions cache name, equal to shiro-activeSessionCache.
&&&&&&&&&&Default no-arg constructor.
protected &void
(&session,
&sessionId)
&&&&&&&&&&Caches the specified session under the cache entry key of sessionId.
protected &void
(&session,
&sessionId,
&,&&cache)
&&&&&&&&&&Caches the specified session in the given cache under the key of sessionId.
(&session)
&&&&&&&&&&Calls super.create(session), then caches the session keyed by the returned sessionId, and then
returns this sessionId.
protected &&,&
&&&&&&&&&&Creates a cache instance used to store active sessions.
(&session)
&&&&&&&&&&Removes the specified session from any cache and then permanently deletes the session from the EIS by
delegating to .
protected abstract &void
(&session)
&&&&&&&&&&Subclass implementation hook to permanently delete the given Session from the underlying EIS.
protected abstract &void
(&session)
&&&&&&&&&&Subclass implementation hook to actually persist the Session's state to the underlying EIS.
&&&&&&&&&&Returns all active sessions in the system.
&&&&&&&&&&Returns the cache instance to use for storing active sessions.
&&&&&&&&&&Returns the name of the actives sessions cache to be returned by the CacheManager.
protected &
(&sessionId)
&&&&&&&&&&Returns the cached session with the corresponding sessionId or null if there is
no session cached under that id (or if there is no Cache).
protected &
(&sessionId,
&,&&cache)
&&&&&&&&&&Returns the Session with the specified id from the specified cache.
&&&&&&&&&&Returns the CacheManager to use for acquiring the
one is not configured.
(&sessionId)
&&&&&&&&&&Attempts to acquire the Session from the cache first using the session ID as the cache key.
(&,&&cache)
&&&&&&&&&&Sets the cache instance to use for storing active sessions.
(&activeSessionsCacheName)
&&&&&&&&&&Sets the name of the active sessions cache to be returned by the CacheManager.
(&cacheManager)
&&&&&&&&&&Sets the cacheManager to use for acquiring the
one is not configured.
protected &void
(&session)
&&&&&&&&&&Removes the specified Session from the cache.
(&session)
&&&&&&&&&&Updates the state of the given session to the EIS by first delegating to
, , , , , , , , , ,
ACTIVE_SESSION_CACHE_NAME
public static final
ACTIVE_SESSION_CACHE_NAME
The default active sessions cache name, equal to shiro-activeSessionCache.
CachingSessionDAO
public CachingSessionDAO()
Default no-arg constructor.
setCacheManager
public void setCacheManager(&cacheManager)
Sets the cacheManager to use for acquiring the
one is not configured.
Specified by: in interface
Parameters:cacheManager - the manager to use for constructing the session cache.
getCacheManager
getCacheManager()
Returns the CacheManager to use for acquiring the
one is not configured.
That is, the CacheManager will only be used if the
property is null.
Returns:the CacheManager used by the implementation that creates the activeSessions Cache.
getActiveSessionsCacheName
getActiveSessionsCacheName()
Returns the name of the actives sessions cache to be returned by the CacheManager.
overridden by , defaults to .
Returns:the name of the active sessions cache.
setActiveSessionsCacheName
public void setActiveSessionsCacheName(&activeSessionsCacheName)
Sets the name of the active sessions cache to be returned by the CacheManager.
Defaults to
Parameters:activeSessionsCacheName - the name of the active sessions cache to be returned by the CacheManager.
getActiveSessionsCache
public &,& getActiveSessionsCache()
Returns the cache instance to use for storing active sessions.
If one is not available (it is null),
it will be
CacheManager using the .
Returns:the cache instance to use for storing active sessions or null if the Cache instance
should be retrieved from the
setActiveSessionsCache
public void setActiveSessionsCache(&,&&cache)
Sets the cache instance to use for storing active sessions.
If one is not set (it remains null),
it will be
CacheManager using the .
Parameters:cache - the cache instance to use for storing active sessions or null if the cache is to be
acquired from the
CacheManager.
createActiveSessionsCache
protected &,& createActiveSessionsCache()
Creates a cache instance used to store active sessions.
Creation is done by first
the CacheManager.
If the cache manager is not null, the
cache returned is that resulting from the following call:
String name = ;
cacheManager.getCache(name);
Returns:a cache instance used to store active sessions, or null if the CacheManager has
not been set.
create(&session)
Calls super.create(session), then caches the session keyed by the returned sessionId, and then
returns this sessionId.
Specified by: in interface Overrides: in class
Parameters:session - Session object to create in the EIS and then cache.
Returns:the EIS id (e.g. primary key) of the created Session object.
getCachedSession
getCachedSession(&sessionId)
Returns the cached session with the corresponding sessionId or null if there is
no session cached under that id (or if there is no Cache).
Parameters:sessionId - the id of the cached session to acquire.
Returns:the cached session with the corresponding sessionId, or null if the session
does not exist or is not cached.
getCachedSession
getCachedSession(&sessionId,
&,&&cache)
Returns the Session with the specified id from the specified cache.
This method simply calls
cache.get(sessionId) and can be overridden by subclasses for custom acquisition behavior.
Parameters:sessionId - the id of the session to acquire.cache - the cache to acquire the session from
Returns:the cached session, or null if the session wasn't in the cache.
protected void cache(&session,
&sessionId)
Caches the specified session under the cache entry key of sessionId.
Parameters:session - the session to cachesessionId - the session id, to be used as the cache entry key.Since:
protected void cache(&session,
&sessionId,
&,&&cache)
Caches the specified session in the given cache under the key of sessionId.
This implementation
simply calls cache.put(sessionId,session) and can be overridden for custom behavior.
Parameters:session - the session to cachesessionId - the id of the session, expected to be the cache key.cache - the cache to store the session
readSession
readSession(&sessionId)
Attempts to acquire the Session from the cache first using the session ID as the cache key.
If no session
is found, super.readSession(sessionId) is called to perform the actual retrieval.
Specified by: in interface Overrides: in class
Parameters:sessionId - the id of the session to retrieve from the EIS.
Returns:the session identified by sessionId in the EIS.
- if the id specified does not correspond to any session in the cache or EIS.
public void update(&session)
Updates the state of the given session to the EIS by first delegating to
If the session is a , it will
be added to the cache only if it is
and if invalid, will be removed from the
If it is not a ValidatingSession instance, it will be added to the cache in any event.
Specified by: in interface
Parameters:session - the session object to update in the EIS.
- if no existing EIS session record exists with the
identifier of
protected abstract void doUpdate(&session)
Subclass implementation hook to actually persist the Session's state to the underlying EIS.
Parameters:session - the session object whose state will be propagated to the EIS.
public void delete(&session)
Removes the specified session from any cache and then permanently deletes the session from the EIS by
delegating to .
Specified by: in interface
Parameters:session - the session to remove from caches and permanently delete from the EIS.
protected abstract void doDelete(&session)
Subclass implementation hook to permanently delete the given Session from the underlying EIS.
Parameters:session - the session instance to permanently delete from the EIS.
protected void uncache(&session)
Removes the specified Session from the cache.
Parameters:session - the session to remove from the cache.
getActiveSessions
public && getActiveSessions()
Returns all active sessions in the system.
This implementation merely returns the sessions found in the activeSessions cache.
Subclass implementations
may wish to override this method to retrieve them in a different way, perhaps by an RDBMS query or by other
Specified by: in interface
Returns:the sessions found in the activeSessions cache.
Copyright &#169;
. All Rights Reserved.

我要回帖

更多关于 java 调用activemq 的文章

 

随机推荐