HttpSessionNotifier.java 文件源码

java
阅读 37 收藏 0 点赞 0 评论 0

项目:HttpSessionReplacer 作者:
/**
 * Notifies listeners that attribute was added. See {@link SessionNotifier}
 * {@link #attributeAdded(RepositoryBackedSession, String, Object)}.
 * <p>
 * If the added attribute <code>value</code> is a HttpSessionBindingListener,
 * it will receive the {@link HttpSessionBindingEvent}. If there are
 * {@link HttpSessionAttributeListener} instances associated to
 * {@link ServletContext}, they will be notified via
 * {@link HttpSessionAttributeListener#attributeAdded(HttpSessionBindingEvent)}
 * .
 */
@Override
public void attributeAdded(RepositoryBackedSession session, String key, Object value) {
  // If the
  if (session instanceof HttpSession && value instanceof HttpSessionBindingListener) {
    ((HttpSessionBindingListener)value).valueBound(new HttpSessionBindingEvent((HttpSession)session, key));
  }
  HttpSessionBindingEvent event = new HttpSessionBindingEvent((HttpSession)session, key, value);
  for (HttpSessionAttributeListener listener : descriptor.getHttpSessionAttributeListeners()) {
    listener.attributeAdded(event);
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号