void registerSessionIfNeeded(HttpSession session) { if (session != null) { synchronized (session) { if (!SESSION_MAP_BY_ID.containsKey(session.getId())) { sessionCreated(new HttpSessionEvent(session)); } } } }
private HttpSessionEvent createHttpSessionEvent(AbstractSessionEvent event) { Session session = event.getSession(); HttpSession httpSession = new HttpSessionAdapter<>(session, this.context); return new HttpSessionEvent(httpSession); }
void triggerPrePassivationEvents(ImmutableSession session) { List<HttpSessionActivationListener> listeners = findListeners(session); if (!listeners.isEmpty()) { HttpSessionEvent event = new HttpSessionEvent(new ImmutableHttpSessionAdapter(session, this.context)); for (HttpSessionActivationListener listener : listeners) { listener.sessionWillPassivate(event); } } }
void triggerPostActivationEvents(ImmutableSession session) { List<HttpSessionActivationListener> listeners = findListeners(session); if (!listeners.isEmpty()) { HttpSessionEvent event = new HttpSessionEvent(new ImmutableHttpSessionAdapter(session, this.context)); for (HttpSessionActivationListener listener : listeners) { listener.sessionDidActivate(event); } } }
void unregisterSessionIfNeeded(HttpSession session) { if (session != null) { try { session.getCreationTime(); // https://issues.jenkins-ci.org/browse/JENKINS-20532 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=413019 session.getLastAccessedTime(); } catch (final IllegalStateException e) { // session.getCreationTime() lance IllegalStateException si la session est invalidée synchronized (session) { sessionDestroyed(new HttpSessionEvent(session)); } } } }
protected HttpSessionEvent getHttpSessionEvent( HttpSessionEvent httpSessionEvent) { if (CompoundSessionIdSplitterUtil.hasSessionDelimiter()) { CompoundSessionIdHttpSession compoundSessionIdHttpSession = new CompoundSessionIdHttpSession(httpSessionEvent.getSession()); httpSessionEvent = new HttpSessionEvent( compoundSessionIdHttpSession); } return httpSessionEvent; }
public void sendSessionDestroyed( HttpSession session ) { HttpSessionEvent event = new HttpSessionEvent( session ); for (Iterator i = _sessionListeners.iterator(); i.hasNext();) { HttpSessionListener listener = (HttpSessionListener) i.next(); listener.sessionDestroyed( event ); } }
public void sendSessionCreated( HttpSession session ) { HttpSessionEvent event = new HttpSessionEvent( session ); for (Iterator i = _sessionListeners.iterator(); i.hasNext();) { HttpSessionListener listener = (HttpSessionListener) i.next(); listener.sessionCreated( event ); } }
public HttpSession getSession(boolean create) { HttpSession previousSession = delegate.getSession(false); HttpSession session = delegate.getSession(create); if (previousSession == null && session != null) { listener.sessionCreated(new HttpSessionEvent(session)); } return session; }
public void callListeners() { if (!this.listeners.isEmpty()) { final HttpSessionEvent event = new HttpSessionEvent(this); for (final HttpSessionListener o : this.listeners) { HttpSessionListener.class.cast(o).sessionCreated(event); } } }
@Override public void sessionDidActivate(HttpSessionEvent se) { if (value instanceof HttpSessionActivationListener) { ((HttpSessionActivationListener) value).sessionDidActivate(new HttpSessionEvent(innerSession)); } }
void registerSessionIfNeeded(HttpSession session) { if (session != null) { synchronized (session) { if (!SESSION_MAP_BY_ID.containsKey(session.getId())) { sessionCreated(new HttpSessionEvent(session)); } } } }
public HttpSession getSession(boolean create) { HttpSession previousSession = delegate.getSession(false); HttpSession session = delegate.getSession(create); if (previousSession == null && session != null) { listener.sessionCreated(new HttpSessionEvent(session)); } return session; }
@Override public void sessionWillPassivate(HttpSessionEvent se) { if (value instanceof HttpSessionActivationListener) { ((HttpSessionActivationListener) value).sessionWillPassivate(new HttpSessionEvent(innerSession)); } }
@Override public void invalidate() { listener.sessionDestroyed(new HttpSessionEvent(session)); } }
public void sendCreatedNotifies() { // Notify session listeners of new session for (int n = 0; n < this.sessionListeners.length; n++) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.webAppConfig.getLoader()); this.sessionListeners[n].sessionCreated(new HttpSessionEvent(this)); Thread.currentThread().setContextClassLoader(cl); } }
public void sessionDestroyed(final HttpSession session) { if(!started) { return; } final HttpSessionEvent sre = new HttpSessionEvent(session); for (int i = httpSessionListeners.length - 1; i >= 0; --i) { ManagedListener listener = httpSessionListeners[i]; this.<HttpSessionListener>get(listener).sessionDestroyed(sre); } }
public void sessionCreated(final HttpSession session) { if(!started) { return; } final HttpSessionEvent sre = new HttpSessionEvent(session); for (int i = 0; i < httpSessionListeners.length; ++i) { this.<HttpSessionListener>get(httpSessionListeners[i]).sessionCreated(sre); } }
public void httpSessionIdChanged(final HttpSession session, final String oldSessionId) { if(!started) { return; } final HttpSessionEvent sre = new HttpSessionEvent(session); for (int i = 0; i < httpSessionIdListeners.length; ++i) { this.<HttpSessionIdListener>get(httpSessionIdListeners[i]).sessionIdChanged(sre, oldSessionId); } }
public void invalidate () { if (m_bInvalidated) throw new IllegalStateException ("Session scope '" + getId () + "' already invalidated!"); m_bInvalidated = true; final HttpSessionEvent aHSE = new HttpSessionEvent (this); for (final HttpSessionListener aListener : MockHttpListener.getAllHttpSessionListeners ()) aListener.sessionDestroyed (aHSE); clearAttributes (); }