@Override public void invalidate() { super.invalidate(); setCurrentSession(null); } }
@Override public void invalidate() { super.invalidate(); setCurrentSession(null); } }
@Override public synchronized HttpSession getSession(boolean create) { if (!initialised) { throw new TestException("Staging server have not been initialised"); } HttpSession httpSession = this.getCurrentSession(); if (null == httpSession && create) { ServerHttpSession sessionImpl = new ServerHttpSession(); // Create proxy objects. ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (null == loader) { loader = this.getClass().getClassLoader(); } httpSession = (HttpSession) Proxy.newProxyInstance(loader, new Class[] { HttpSession.class }, getInvocationHandler(sessionImpl)); setCurrentSession(httpSession); // inform session listeners. final HttpSessionEvent event = new HttpSessionEvent(httpSession); fireEvent(SESSION_LISTENER_CLASS, new EventInvoker<HttpSessionListener>() { public void invoke(HttpSessionListener listener) { listener.sessionCreated(event); } }); sessionInstances.add(sessionImpl); } return httpSession; }
@Override public synchronized HttpSession getSession(boolean create) { if (!initialised) { throw new TestException("Staging server have not been initialised"); } HttpSession httpSession = this.getCurrentSession(); if (null == httpSession && create) { ServerHttpSession sessionImpl = new ServerHttpSession(); // Create proxy objects. ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (null == loader) { loader = this.getClass().getClassLoader(); } httpSession = (HttpSession) Proxy.newProxyInstance(loader, new Class[] { HttpSession.class }, getInvocationHandler(sessionImpl)); setCurrentSession(httpSession); // inform session listeners. final HttpSessionEvent event = new HttpSessionEvent(httpSession); fireEvent(SESSION_LISTENER_CLASS, new EventInvoker<HttpSessionListener>() { public void invoke(HttpSessionListener listener) { listener.sessionCreated(event); } }); sessionInstances.add(sessionImpl); } return httpSession; }
sessionIterator.remove(); setCurrentSession(null);
sessionIterator.remove(); setCurrentSession(null);