01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package javax.servlet.http;
05:
06: public class MockSessionListener implements HttpSessionListener {
07:
08: private String lastMethod;
09: private HttpSessionEvent lastEvent;
10:
11: public void sessionCreated(HttpSessionEvent e) {
12: this .lastMethod = "sessionCreated";
13: this .lastEvent = e;
14: }
15:
16: public void sessionDestroyed(HttpSessionEvent e) {
17: this .lastMethod = "sessionDestroyed";
18: this .lastEvent = e;
19: }
20:
21: public void clear() {
22: this .lastEvent = null;
23: this .lastMethod = null;
24: }
25:
26: public HttpSessionEvent getLastEvent() {
27: return lastEvent;
28: }
29:
30: public String getLastMethod() {
31: return lastMethod;
32: }
33:
34: }
|