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 MockSessionAttributeListener implements
07: HttpSessionAttributeListener {
08:
09: private String lastMethod;
10: private HttpSessionBindingEvent lastEvent;
11:
12: public void attributeAdded(HttpSessionBindingEvent e) {
13: this .lastMethod = "attributeAdded";
14: this .lastEvent = e;
15: }
16:
17: public void attributeRemoved(HttpSessionBindingEvent e) {
18: this .lastMethod = "attributeRemoved";
19: this .lastEvent = e;
20: }
21:
22: public void attributeReplaced(HttpSessionBindingEvent e) {
23: this .lastMethod = "attributeReplaced";
24: this .lastEvent = e;
25: }
26:
27: public void clear() {
28: this .lastMethod = null;
29: this .lastEvent = null;
30: }
31:
32: public HttpSessionBindingEvent getLastEvent() {
33: return lastEvent;
34: }
35:
36: public String getLastMethod() {
37: return lastMethod;
38: }
39: }
|