1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.chain.impl;
17
18
19 import org.apache.commons.chain.Context;
20 import org.apache.commons.chain.Filter;
21
22
23 /***
24 * <p>Implementation of {@link Filter} that logs its identifier and
25 * and throws an Exception.</p>
26 *
27 * @author Craig R. McClanahan
28 * @version $Revision: 155403 $ $Date: 2005-02-26 12:52:46 +0000 (Sat, 26 Feb 2005) $
29 */
30 public class ExceptionFilter extends ExceptionCommand implements Filter {
31
32
33
34
35
36 public ExceptionFilter() {
37 this("", "");
38 }
39
40
41
42 public ExceptionFilter(String id1, String id2) {
43 super(id1);
44 this.id2 = id2;
45 }
46
47
48
49
50 protected String id2 = null;
51 public String getId2() {
52 return (this.id2);
53 }
54 public void setId2(String id2) {
55 this.id2 = id2;
56 }
57
58
59
60
61
62
63 public boolean postprocess(Context context, Exception exception) {
64 log(context, id2);
65 return (false);
66 }
67
68
69 }