KickJava   Java API By Example, From Geeks To Geeks.

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


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 MockSessionListener implements HttpSessionListener JavaDoc {
7
8   private String JavaDoc lastMethod;
9   private HttpSessionEvent JavaDoc lastEvent;
10
11   public void sessionCreated(HttpSessionEvent JavaDoc e) {
12     this.lastMethod = "sessionCreated";
13     this.lastEvent = e;
14   }
15
16   public void sessionDestroyed(HttpSessionEvent JavaDoc 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 JavaDoc getLastEvent() {
27     return lastEvent;
28   }
29
30   public String JavaDoc getLastMethod() {
31     return lastMethod;
32   }
33
34 }
35
Popular Tags