01: /*
02: * $Id: IRequestTarget.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;
19:
20: /**
21: * <p>
22: * A request target is the base entity that is the subject of a request.
23: * Different types of request have different request targets. For instance a
24: * request for a bookmarkable page differs from a request for a link on a
25: * previously rendered page, which in turn differs from a request for a shared
26: * resource.
27: * </p>
28: * <p>
29: * It is very important (for mounting) that implementations implement
30: * {@link java.lang.Object#equals(java.lang.Object)} and
31: * {@link java.lang.Object#hashCode()} in a consistent way.
32: * </p>
33: * Typically, implementations of IRequestTarget are not meant to be used more
34: * than once.
35: *
36: * @author Eelco Hillenius
37: */
38: public interface IRequestTarget {
39: /**
40: * Generates a response.
41: *
42: * @param requestCycle
43: * the current request cycle
44: */
45: void respond(RequestCycle requestCycle);
46:
47: /**
48: * This method is alled on the end of a request cycle to indicate that
49: * processing is done and that cleaning up of the subject(s) of this target
50: * may be done.
51: *
52: * @param requestCycle
53: * the current request cycle
54: */
55: void detach(RequestCycle requestCycle);
56:
57: /**
58: * Gets the lock to be used for synchronization.
59: *
60: * @param requestCycle
61: * the current request cycle
62: *
63: * @return Any lock to be used to synchronize this target or null if no
64: * synchronization is needed.
65: */
66: Object getLock(RequestCycle requestCycle);
67: }
|