01: /*
02: * $Id: IResourceListener.java 459258 2006-02-13 05:23:54Z jonl $
03: * $Revision: 459258 $ $Date: 2006-02-13 06:23:54 +0100 (Mon, 13 Feb 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: import wicket.request.RequestParameters;
21: import wicket.request.target.resource.ComponentResourceRequestTarget;
22:
23: /**
24: * Listens for requests regarding resources. Such resources are typically
25: * non-static in nature and may even be created on the fly.
26: * <p>
27: * One use for resource listeners is that they may be used to create components
28: * such as Image which respond to requests with a localized resource loaded from
29: * the classpath. The Image class allows reusable components to transparently
30: * bundle localized image resources. Components that use Image resources
31: * (instead of referencing static images in their markup) can be distributed as
32: * a self-contained JAR file.
33: *
34: * @see wicket.markup.html.image.Image
35: * @see wicket.markup.html.image.resource.RenderedDynamicImageResource
36: * @author Jonathan Locke
37: */
38: public interface IResourceListener extends IRequestListener {
39: /** Resource listener interface object */
40: public static final RequestListenerInterface INTERFACE = new RequestListenerInterface(
41: IResourceListener.class) {
42: public IRequestTarget newRequestTarget(Page page,
43: Component component, RequestListenerInterface listener,
44: RequestParameters requestParameters) {
45: return new ComponentResourceRequestTarget(page, component,
46: listener);
47: }
48: };
49:
50: /**
51: * Called when a resource is requested.
52: */
53: void onResourceRequested();
54: }
|