當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。