01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.wicket;
18:
19: import org.apache.wicket.request.RequestParameters;
20: import org.apache.wicket.request.target.resource.ComponentResourceRequestTarget;
21:
22: /**
23: * Listens for requests regarding resources. Such resources are typically
24: * non-static in nature and may even be created on the fly.
25: * <p>
26: * One use for resource listeners is that they may be used to create components
27: * such as Image which respond to requests with a localized resource loaded from
28: * the classpath. The Image class allows reusable components to transparently
29: * bundle localized image resources. Components that use Image resources
30: * (instead of referencing static images in their markup) can be distributed as
31: * a self-contained JAR file.
32: *
33: * @see org.apache.wicket.markup.html.image.Image
34: * @see org.apache.wicket.markup.html.image.resource.RenderedDynamicImageResource
35: * @author Jonathan Locke
36: */
37: public interface IResourceListener extends IRequestListener {
38: /** Resource listener interface object */
39: public static final RequestListenerInterface INTERFACE = new RequestListenerInterface(
40: IResourceListener.class) {
41: public IRequestTarget newRequestTarget(Page page,
42: Component component, RequestListenerInterface listener,
43: RequestParameters requestParameters) {
44: return new ComponentResourceRequestTarget(page, component,
45: listener);
46: }
47: };
48:
49: /**
50: * Called when a resource is requested.
51: */
52: void onResourceRequested();
53: }
|