KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > servlet > http > MockSessionAttributeListener


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package javax.servlet.http;
5
6 public class MockSessionAttributeListener implements HttpSessionAttributeListener JavaDoc {
7
8   private String JavaDoc lastMethod;
9   private HttpSessionBindingEvent JavaDoc lastEvent;
10
11   public void attributeAdded(HttpSessionBindingEvent JavaDoc e) {
12     this.lastMethod = "attributeAdded";
13     this.lastEvent = e;
14   }
15
16   public void attributeRemoved(HttpSessionBindingEvent JavaDoc e) {
17     this.lastMethod = "attributeRemoved";
18     this.lastEvent = e;
19   }
20
21   public void attributeReplaced(HttpSessionBindingEvent JavaDoc e) {
22     this.lastMethod = "attributeReplaced";
23     this.lastEvent = e;
24   }
25
26   public void clear() {
27     this.lastMethod = null;
28     this.lastEvent = null;
29   }
30
31   public HttpSessionBindingEvent JavaDoc getLastEvent() {
32     return lastEvent;
33   }
34
35   public String JavaDoc getLastMethod() {
36     return lastMethod;
37   }
38 }
39
Popular Tags