
com.github.ibole.infrastructure.cache.session.redis.RequestEventSubject Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infrastructure-all Show documentation
Show all versions of infrastructure-all Show documentation
The all in one project of ibole infrastructure
The newest version!
package com.github.ibole.infrastructure.cache.session.redis;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/*********************************************************************************************
* .
*
*
* Copyright 2016, iBole Inc. All rights reserved.
*
*
*
*********************************************************************************************/
/**
* Request事件主题,主要是为了在请求结束后同步本地Session到Redis.
*
*/
public class RequestEventSubject {
private RequestEventObserver listener;
public void attach(RequestEventObserver eventObserver) {
this.listener = eventObserver;
}
public void detach() {
this.listener = null;
}
/**
* 请求结束后执行监听事件.
*
* @param req HttpServletRequest
* @param res HttpServletResponse
*/
public void completed(HttpServletRequest req, HttpServletResponse res) {
if (this.listener != null) {
this.listener.completed(req, res);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy