01: /*
02: * $Id: EmptyRequestTarget.java 459916 2006-03-21 00:46:45Z jonl $
03: * $Revision: 459916 $ $Date: 2006-03-21 01:46:45 +0100 (Tue, 21 Mar 2006) $
04: *
05: * ==============================================================================
06: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
07: * use this file except in compliance with the License. You may obtain a copy of
08: * the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15: * License for the specific language governing permissions and limitations under
16: * the License.
17: */
18: package wicket.request.target.basic;
19:
20: import wicket.IRequestTarget;
21: import wicket.RequestCycle;
22:
23: /**
24: * The empty request target does nothing in itself but instead relies on some
25: * other source to generate a response. It can be regarded as a dummy
26: * implementation.
27: *
28: * @author Eelco Hillenius
29: */
30: public final class EmptyRequestTarget implements IRequestTarget {
31: /** immutable hashcode. */
32: private static final int HASH = 17 * 3214424;
33:
34: /** singleton instance. */
35: private static final EmptyRequestTarget instance = new EmptyRequestTarget();
36:
37: /**
38: * Construct.
39: */
40: private EmptyRequestTarget() {
41: }
42:
43: /**
44: * Gets the singleton instance.
45: *
46: * @return the singleton instance
47: */
48: public static final EmptyRequestTarget getInstance() {
49: return instance;
50: }
51:
52: /**
53: * Does nothing at all.
54: *
55: * @see wicket.IRequestTarget#respond(wicket.RequestCycle)
56: */
57: public void respond(RequestCycle requestCycle) {
58: }
59:
60: /**
61: * @see wicket.IRequestTarget#detach(wicket.RequestCycle)
62: */
63: public void detach(RequestCycle requestCycle) {
64: }
65:
66: /**
67: * @see wicket.IRequestTarget#getLock(RequestCycle)
68: */
69: public Object getLock(RequestCycle requestCycle) {
70: return null;
71: }
72:
73: /**
74: * @see java.lang.Object#equals(java.lang.Object)
75: */
76: public boolean equals(Object obj) {
77: if (obj instanceof EmptyRequestTarget) {
78: return true;
79: }
80: return false;
81: }
82:
83: /**
84: * @see java.lang.Object#hashCode()
85: */
86: public int hashCode() {
87: return HASH;
88: }
89:
90: /**
91: * @see java.lang.Object#toString()
92: */
93: public String toString() {
94: return "EmptyRequestTarget";
95: }
96: }
|