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 returns <code>true</code>.</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
31 public class NonDelegatingFilter extends NonDelegatingCommand
32 implements Filter {
33
34
35
36
37
38 public NonDelegatingFilter() {
39 this("", "");
40 }
41
42
43
44 public NonDelegatingFilter(String id1, String id2) {
45 super(id1);
46 this.id2 = id2;
47 }
48
49
50
51
52
53 protected String id2 = null;
54 public String getId2() {
55 return (this.id2);
56 }
57 public void setId2(String id2) {
58 this.id2 = id2;
59 }
60
61
62
63
64
65
66 public boolean execute(Context context) throws Exception {
67
68 super.execute(context);
69 return (true);
70
71 }
72
73
74
75 public boolean postprocess(Context context, Exception exception) {
76 log(context, id2);
77 return (false);
78 }
79
80
81 }