01: /*
02: * $Id: IInitializer.java 4597 2006-02-21 22:08:11 +0000 (Tue, 21 Feb 2006)
03: * jdonnerstag $ $Revision: 464641 $ $Date: 2006-02-21 22:08:11 +0000 (Tue, 21 Feb
04: * 2006) $
05: *
06: * ==============================================================================
07: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
08: * use this file except in compliance with the License. You may obtain a copy of
09: * the License at
10: *
11: * http://www.apache.org/licenses/LICENSE-2.0
12: *
13: * Unless required by applicable law or agreed to in writing, software
14: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16: * License for the specific language governing permissions and limitations under
17: * the License.
18: */
19: package wicket;
20:
21: import wicket.markup.html.PackageResource;
22:
23: /**
24: * Initializes something when application loads.
25: *
26: * Initializer is there for clustering. Lets say you access a page that has a
27: * link to a resource on node A now the url for the resource gets forwarded to
28: * node B, but node B doesnt have the resource registered yet because maybe the
29: * page class hasn't been loaded and so its static block hasn't run yet. So the
30: * initializer is a place for you to register all those resources and do all the
31: * stuff you used to do in the static blocks.
32: * <p>
33: * You don't have to pre-register {@link PackageResource package resources}, as
34: * they can be initialized lazily.
35: * </p>
36: * <p>
37: * Initializers can be configured by having a wicket.properties file in the
38: * class path root, with property 'initializer=${initializer class name}'. You
39: * can have one such properties per jar file, but the initializer that property
40: * denotes can delegate to other initializers of that library.
41: * </p>
42: * <p>
43: * If an initializer also implement {@link IDestroyer}, the instance will be
44: * kept for destroying, so that it may clean up whatever it did when
45: * initializing.
46: * </p>
47: *
48: * @author Jonathan Locke
49: */
50: public interface IInitializer {
51: /**
52: * @param application
53: * The application loading the component
54: */
55: void init(Application application);
56: }
|