public void removeAttribute(String name) { invalidateIfNeeded(); Object value = attributes.remove(name); if (value != null && value instanceof ScriptSessionBindingListener) { ScriptSessionBindingListener listener = (ScriptSessionBindingListener) value; listener.valueUnbound(new ScriptSessionBindingEvent(this, name)); } }
public void invalidate() { invalidated = true; // attributes is a concurrent map and can be safely iterated. for (Map.Entry<String, Object> entry : attributes.entrySet()) { Object value = entry.getValue(); if (value instanceof ScriptSessionBindingListener) { ScriptSessionBindingListener listener = (ScriptSessionBindingListener) value; listener.valueUnbound(new ScriptSessionBindingEvent(this, entry.getKey())); } } if (manager instanceof DefaultScriptSessionManager) { ((DefaultScriptSessionManager) manager).invalidate(this); } }