1 4 package javax.servlet.http; 5 6 public class MockSessionAttributeListener implements HttpSessionAttributeListener { 7 8 private String lastMethod; 9 private HttpSessionBindingEvent lastEvent; 10 11 public void attributeAdded(HttpSessionBindingEvent e) { 12 this.lastMethod = "attributeAdded"; 13 this.lastEvent = e; 14 } 15 16 public void attributeRemoved(HttpSessionBindingEvent e) { 17 this.lastMethod = "attributeRemoved"; 18 this.lastEvent = e; 19 } 20 21 public void attributeReplaced(HttpSessionBindingEvent 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 getLastEvent() { 32 return lastEvent; 33 } 34 35 public String getLastMethod() { 36 return lastMethod; 37 } 38 } 39 | Popular Tags |