View Javadoc
1   /*
2    * Copyright 2007 Ralf Joachim
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5    * in compliance with the License. You may obtain a copy of the License at
6    *
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software distributed under the License
10   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11   * or implied. See the License for the specific language governing permissions and limitations under
12   * the License.
13   *
14   * $Id: Configuration.java 6907 2007-03-28 21:24:52Z rjoachim $
15   */
16  package org.castor.core;
17  
18  import org.castor.core.util.AbstractProperties;
19  
20  /**
21   * Properties of core modul.
22   * 
23   * @version $Id: Configuration.java,v 1.8 2006/03/08 17:25:52 jens Exp $
24   * @author <a href="mailto:ralf DOT joachim AT syscon DOT eu">Ralf Joachim</a>
25   * @since 1.1.3
26   */
27  public class CoreProperties extends AbstractProperties {
28    // --------------------------------------------------------------------------
29  
30    /** Path to Castor properties of core modul. */
31    private static final String FILEPATH = "/org/castor/core/";
32  
33    /** Name of Castor properties of core modul. */
34    private static final String FILENAME = "castor.core.properties";
35  
36    // --------------------------------------------------------------------------
37  
38    /**
39     * Default constructor. Application and domain class loaders will be initialized to the one used
40     * to load this class. No parent properties will be set. <br/>
41     * Note: This constructor is not intended for public use. Use one of the newInstance() methods of
42     * the modul specific properties instead.
43     */
44    public CoreProperties() {
45      super();
46      loadDefaultProperties(FILEPATH, FILENAME);
47    }
48  
49    /**
50     * Construct properties that uses the specified class loaders. No parent properties will be set.
51     * <br/>
52     * Note: This constructor is not intended for public use. Use one of the newInstance() methods of
53     * the modul specific properties instead.
54     * 
55     * @param app Classloader to be used for all classes of Castor and its required libraries.
56     * @param domain Classloader to be used for all domain objects.
57     */
58    public CoreProperties(final ClassLoader application, final ClassLoader domain) {
59      super(application, domain);
60      loadDefaultProperties(FILEPATH, FILENAME);
61    }
62  
63    // --------------------------------------------------------------------------
64  
65    // Specify public keys of core configuration properties here.
66  
67    /**
68     * Property listing all available {@link org.exolab.castor.mapping.MappingLoader} implementations
69     * (<tt>org.castor.mapping.Loaders</tt>).
70     */
71    public static final String MAPPING_LOADER_FACTORIES = "org.castor.mapping.loaderFactories";
72  
73    // --------------------------------------------------------------------------
74  }