1 /*
2 * $Id$
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21 package org.apache.struts.config;
22
23 /**
24 * This interface is to be implemented by any plugin for custom modification of
25 * a module after it is been configured but before it is frozen. This allows for
26 * overriding or adding properties after standard initialization.
27 * <p>
28 * The types of child configurations provided are {@link ActionConfig},
29 * {@link ExceptionConfig}, {@link ForwardConfig} and
30 * {@link MessageResourcesConfig}. If interested in a particular configuration
31 * class, use the <code>instanceof</code> operator to check before casting.
32 * <p>
33 * Possible post-processors implementations may include property substitutions (<code>${...}</code>),
34 * querying additional configuration from a repository, extended configuration
35 * validation, preparing message resources for a particular domain/host,
36 * logging, etc.
37 *
38 * @see BaseConfig
39 * @see ActionConfig
40 * @see ExceptionConfig
41 * @see ForwardConfig
42 * @see MessageResourcesConfig
43 * @see ModuleConfig
44 * @since Struts 1.4
45 * @version $Rev$
46 */
47 public interface ModuleConfigPostProcessor {
48
49 /**
50 * Applies this post-processor to the specified configuration object after
51 * it has been initialized by Struts but before it is frozen.
52 *
53 * @param config the configuration
54 * @param moduleConfig the parent module configuration
55 */
56 void postProcessAfterInitialization(BaseConfig config, ModuleConfig moduleConfig);
57
58 /**
59 * Modify the specified module after its standard initialization.
60 *
61 * @param moduleConfig the module configuration
62 */
63 void postProcessAfterInitialization(ModuleConfig moduleConfig);
64
65 /**
66 * Applies this post-processor to the specified configuration object
67 * <i>before</i> it has been initialized and processed by Struts (such as
68 * heirarchy extensions).
69 *
70 * @param config the configuration
71 * @param moduleConfig the parent module configuration
72 */
73 void postProcessBeforeInitialization(BaseConfig config, ModuleConfig moduleConfig);
74
75 }