01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tctest.webapp.listeners;
05:
06: import com.tctest.webapp.servlets.InvalidatorServlet;
07:
08: import javax.servlet.http.HttpSessionBindingEvent;
09: import javax.servlet.http.HttpSessionBindingListener;
10:
11: public class BindingListenerWithException implements
12: HttpSessionBindingListener {
13: private final String key;
14:
15: public BindingListenerWithException() {
16: key = null;
17: }
18:
19: public BindingListenerWithException(String key) {
20: this .key = key;
21: }
22:
23: public void valueBound(HttpSessionBindingEvent arg0) {
24: InvalidatorServlet
25: .incrementCallCount("BindingListener.valueBound");
26: throw new RuntimeException("Testing Exception Delivery");
27: }
28:
29: public void valueUnbound(HttpSessionBindingEvent arg0) {
30: InvalidatorServlet
31: .incrementCallCount("BindingListener.valueUnbound");
32: throw new RuntimeException("Testing Exception Delivery");
33: }
34:
35: public String toString() {
36: return key;
37: }
38: }
|