removeAttribute(name); return; throw new IllegalStateException(); if (_values==null) _values=newAttributeMap(); Object oldValue=_values.put(name,value); unbindValue(name,oldValue); bindValue(name,value);
protected void addSession(AbstractSessionManager.Session session) { _sessions.put(session.getClusterId(),session); }
public String toString() { return this.getClass().getName()+":"+getId()+"@"+hashCode(); }
if (getSession(session.getClusterId()) != null) removeSession(session.getClusterId()); _sessionIdManager.invalidateAll(session.getClusterId()); session.willPassivate();
/** * Add the session Registers the session with this manager and registers the * session ID with the sessionIDManager; */ protected void addSession(Session session, boolean created) { synchronized (_sessionIdManager) { _sessionIdManager.addSession(session); synchronized (this) { addSession(session); if (getSessions()>this._maxSessions) this._maxSessions=getSessions(); } } if (!created) { session.didActivate(); } else if (_sessionListeners!=null) { HttpSessionEvent event=new HttpSessionEvent(session); for (int i=0; i<LazyList.size(_sessionListeners); i++) ((HttpSessionListener)LazyList.get(_sessionListeners,i)).sessionCreated(event); } }
public Cookie access(HttpSession session,boolean secure) { long now=System.currentTimeMillis(); Session s = ((SessionIf)session).getSession(); s.access(now); // Do we need to refresh the cookie? if (isUsingCookies() && (s.isIdChanged() || (getMaxCookieAge()>0 && getRefreshCookieAge()>0 && ((now-s.getCookieSetTime())/1000>getRefreshCookieAge())) ) ) { Cookie cookie=getSessionCookie(session,_context.getContextPath(),secure); s.cookieSet(); s.setIdChanged(false); return cookie; } return null; }
protected void timeout() throws IllegalStateException { // remove session from context and invalidate other sessions with same ID. removeSession(this,true); // Notify listeners and unbind values synchronized (this) { if (_requests<=0) doInvalidate(); else _doInvalidate=true; } }
protected void complete() { synchronized(this) { _requests--; if (_doInvalidate && _requests<=0 ) doInvalidate(); } }
public String getClusterId(HttpSession session) { Session s = ((SessionIf)session).getSession(); return s.getClusterId(); }
/** * @deprecated As of Version 2.2, this method is replaced by * {@link #getAttribute} */ public Object getValue(String name) throws IllegalStateException { return getAttribute(name); }
public void complete(HttpSession session) { Session s = ((SessionIf)session).getSession(); s.complete(); }
public void invalidate() throws IllegalStateException { // remove session from context and invalidate other sessions with same ID. removeSession(this,true); doInvalidate(); }