当前位置: 首页>>代码示例>>Java>>正文


Java HttpSessionBindingListener.valueUnbound方法代码示例

本文整理汇总了Java中javax.servlet.http.HttpSessionBindingListener.valueUnbound方法的典型用法代码示例。如果您正苦于以下问题:Java HttpSessionBindingListener.valueUnbound方法的具体用法?Java HttpSessionBindingListener.valueUnbound怎么用?Java HttpSessionBindingListener.valueUnbound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.servlet.http.HttpSessionBindingListener的用法示例。


在下文中一共展示了HttpSessionBindingListener.valueUnbound方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cleanUpAttributes

import javax.servlet.http.HttpSessionBindingListener; //导入方法依赖的package包/类
private void cleanUpAttributes() {
    if (!isValid())
        throw new IllegalStateException(
            "Method is called on an invalidated session");
    Iterator iter = attributes.entrySet().iterator();
    while (iter.hasNext()) {
        Entry e = (Entry) iter.next();
        String name = e.getKey() + "";
        Object value = e.getValue();
        iter.remove();
        try {
            HttpSessionBindingListener listener = (HttpSessionBindingListener) value;
            listener.valueUnbound(new HttpSessionBindingEvent(this, name, value));
            listener.notifyAll();
        }
        catch (ClassCastException err) { }
    }
}
 
开发者ID:wzhishen,项目名称:youtube-cache,代码行数:19,代码来源:FakeSession.java

示例2: clearAttributes

import javax.servlet.http.HttpSessionBindingListener; //导入方法依赖的package包/类
/**
 * Clears the attribute map, potentially calling the valueUnbound
 * methods of any attributes which implement the
 * {@link javax.servlet.http.HttpSessionBindingListener} interface.
 */
protected void clearAttributes() {
  checkValid();
  // call value unbound where appropriate...
  for (Map.Entry<String, Object> entry : sessionData_.entrySet()) {
    Object value = entry.getValue();
    if (value instanceof HttpSessionBindingListener) {
      String name = entry.getKey();
      HttpSessionBindingListener hsbl = (HttpSessionBindingListener) value;
      hsbl.valueUnbound(new HttpSessionBindingEvent(this, name));
    }
  }
  sessionData_.clear();
}
 
开发者ID:bboypscmylife,项目名称:opengse,代码行数:19,代码来源:HttpSessionImpl.java

示例3: afterUnbound

import javax.servlet.http.HttpSessionBindingListener; //导入方法依赖的package包/类
protected void afterUnbound(String s, Object o) {
    if (o instanceof HttpSessionBindingListener) {
        HttpSessionBindingListener listener = (HttpSessionBindingListener) o;
        HttpSessionBindingEvent event = new HttpSessionBindingEvent(this, s, o);
        listener.valueUnbound(event);
    }
}
 
开发者ID:xuegongzi,项目名称:rabbitframework,代码行数:8,代码来源:ShiroHttpSession.java

示例4: removeAttribute

import javax.servlet.http.HttpSessionBindingListener; //导入方法依赖的package包/类
/**
 * Removes the object bound with the specified name from this session. 
 * If the session does not have an object bound with the specified name, 
 * this method does nothing.
 * @param name The name of the object to remove from this session.
 */
public void removeAttribute(String name) {
    if (!isValid())
        throw new IllegalStateException(
            "Method is called on an invalidated session");
    Object value = attributes.remove(name);
    try {
        HttpSessionBindingListener listener = (HttpSessionBindingListener) value;
        listener.valueUnbound(new HttpSessionBindingEvent(this, name, value));
        listener.notifyAll();
    }
    catch (ClassCastException e) { }
}
 
开发者ID:wzhishen,项目名称:youtube-cache,代码行数:19,代码来源:FakeSession.java


注:本文中的javax.servlet.http.HttpSessionBindingListener.valueUnbound方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。