1 4 package javax.servlet.http; 5 6 public class MockSessionListener implements HttpSessionListener { 7 8 private String lastMethod; 9 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 } 35 | Popular Tags |