protected void afterBound(String s, Object o) { if (o instanceof HttpSessionBindingListener) { HttpSessionBindingListener listener = (HttpSessionBindingListener) o; HttpSessionBindingEvent event = new HttpSessionBindingEvent(this, s, o); listener.valueBound(event); } }
@Override public void setAttribute(String name, @Nullable Object value) { assertIsValid(); Assert.notNull(name, "Attribute name must not be null"); if (value != null) { Object oldValue = this.attributes.put(name, value); if (value != oldValue) { if (oldValue instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) oldValue).valueUnbound(new HttpSessionBindingEvent(this, name, oldValue)); } if (value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value).valueBound(new HttpSessionBindingEvent(this, name, value)); } } } else { removeAttribute(name); } }
@Override public void setAttribute(String name, Object value) { assertIsValid(); Assert.notNull(name, "Attribute name must not be null"); if (value != null) { this.attributes.put(name, value); if (value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value).valueBound(new HttpSessionBindingEvent(this, name, value)); } } else { removeAttribute(name); } }
@Override public void setAttribute(String name, @Nullable Object value) { assertIsValid(); Assert.notNull(name, "Attribute name must not be null"); if (value != null) { Object oldValue = this.attributes.put(name, value); if (value != oldValue) { if (oldValue instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) oldValue).valueUnbound(new HttpSessionBindingEvent(this, name, oldValue)); } if (value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value).valueBound(new HttpSessionBindingEvent(this, name, value)); } } } else { removeAttribute(name); } }
@Override public void setAttribute(String name, Object value) { checkState(); Object oldValue = this.session.getAttribute(name); this.session.setAttribute(name, value); if (value != oldValue) { if (oldValue instanceof HttpSessionBindingListener) { try { ((HttpSessionBindingListener) oldValue).valueUnbound( new HttpSessionBindingEvent(this, name, oldValue)); } catch (Throwable th) { logger.error("Error invoking session binding event listener", th); } } if (value instanceof HttpSessionBindingListener) { try { ((HttpSessionBindingListener) value) .valueBound(new HttpSessionBindingEvent(this, name, value)); } catch (Throwable th) { logger.error("Error invoking session binding event listener", th); } } } }
@Override public void valueBound(HttpSessionBindingEvent httpSessionBindingEvent) { if (_httpSessionBindingListeners == null) { return; } for (HttpSessionBindingListener httpSessionBindingListener : _httpSessionBindingListeners) { httpSessionBindingListener.valueBound(httpSessionBindingEvent); } }
@Override public void valueBound(HttpSessionBindingEvent httpSessionBindingEvent) { if (_httpSessionBindingListeners.isEmpty()) { return; } httpSessionBindingEvent = getHttpSessionBindingEvent( httpSessionBindingEvent); for (HttpSessionBindingListener httpSessionBindingListener : _httpSessionBindingListeners) { httpSessionBindingListener.valueBound(httpSessionBindingEvent); } }
@Override public void setAttribute(String name, Object value) { if (attributes == null) { attributes = new ConcurrentHashMap<>(); } attributes.put(name, value); if (value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value) .valueBound(new HttpSessionBindingEvent(this, name, value)); } }
/** If value implements HttpSessionBindingListener, call valueBound() */ public void bindValue(java.lang.String name, Object value) { if (value!=null&&value instanceof HttpSessionBindingListener) ((HttpSessionBindingListener)value).valueBound(new HttpSessionBindingEvent(this,name)); }
private synchronized void callValueBoundMethod(String key, Object value) { if (value instanceof HttpSessionBindingListener) { HttpSessionBindingEvent event = new HttpSessionBindingEvent(this, key, value); ((HttpSessionBindingListener) value).valueBound(event); } }
/** * Bind value if value implements {@link HttpSessionBindingListener} (calls {@link HttpSessionBindingListener#valueBound(HttpSessionBindingEvent)}) * @param name the name with which the object is bound or unbound * @param value the bound value */ public void bindValue(java.lang.String name, Object value) { if (value!=null&&value instanceof HttpSessionBindingListener) ((HttpSessionBindingListener)value).valueBound(new HttpSessionBindingEvent(this,name)); }
/** If value implements HttpSessionBindingListener, call valueBound() */ public void bindValue(java.lang.String name, Object value) { if (value!=null&&value instanceof HttpSessionBindingListener) ((HttpSessionBindingListener)value).valueBound(new HttpSessionBindingEvent(this,name)); }
/** If value implements HttpSessionBindingListener, call valueBound() */ public void bindValue(java.lang.String name, Object value) { if (value!=null&&value instanceof HttpSessionBindingListener) ((HttpSessionBindingListener)value).valueBound(new HttpSessionBindingEvent(this,name)); }
@Override public void setAttribute(String name, Object value) { if (attributes == null) attributes = new ConcurrentHashMap<String, Object>(); attributes.put(name, value); if (value != null && value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value).valueBound(new HttpSessionBindingEvent(this, name, value)); } }
/** If value implements HttpSessionBindingListener, call valueBound() */ public void bindValue(java.lang.String name, Object value) { if (value!=null&&value instanceof HttpSessionBindingListener) ((HttpSessionBindingListener)value).valueBound(new HttpSessionBindingEvent(this,name)); }
/** If value implements HttpSessionBindingListener, call valueBound() */ public void bindValue(java.lang.String name, Object value) { if (value!=null&&value instanceof HttpSessionBindingListener) ((HttpSessionBindingListener)value).valueBound(new HttpSessionBindingEvent(this,name)); }
@Override public void setAttribute(String name, Object value) { if(value == null) { removeAttribute(name); } else { attributes.put(name, value); if(value instanceof HttpSessionBindingListener) { HttpSessionBindingEvent event = new HttpSessionBindingEvent(this, name, value); ((HttpSessionBindingListener)value).valueBound(event); } } }
@Override public void attributeAdded(final Session session, final String name, final Object value) { if (name.startsWith(IO_UNDERTOW)) { return; } final HttpSessionImpl httpSession = SecurityActions.forSession(session, servletContext, false); applicationListeners.httpSessionAttributeAdded(httpSession, name, value); if (value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value).valueBound(new HttpSessionBindingEvent(httpSession, name, value)); } }
@Override public void attributeAdded(final Session session, final String name, final Object value) { if(name.startsWith(IO_UNDERTOW)) { return; } final HttpSession httpSession = SecurityActions.forSession(session, servletContext, false, manager); applicationListeners.httpSessionAttributeAdded(httpSession, name, value); if (value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value).valueBound(new HttpSessionBindingEvent(httpSession, name, value)); } }
@Override public void attributeAdded(final Session session, final String name, final Object value) { if(name.startsWith(IO_UNDERTOW)) { return; } final HttpSession httpSession = SecurityActions.forSession(session, servletContext, false, manager); applicationListeners.httpSessionAttributeAdded(httpSession, name, value); if (value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value).valueBound(new HttpSessionBindingEvent(httpSession, name, value)); } }