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