01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.openjpa.lib.conf;
20:
21: import java.util.Map;
22:
23: /**
24: * Implementations of this interface can populate {@link Configuration}s in
25: * some environment-specific way. Implementations must implement the
26: * <code>equals</code> and <code>hashCode</code> methods so that equivalent
27: * configurations compare equal.
28: *
29: * @nojavadoc
30: * @since 0.4.0.0
31: */
32: public interface ConfigurationProvider {
33:
34: /**
35: * Return properties loaded thus far, or empty map if none.
36: */
37: public Map getProperties();
38:
39: /**
40: * Add the given properties to those in this provider, overwriting
41: * any exisitng properties under the same keys.
42: */
43: public void addProperties(Map props);
44:
45: /**
46: * Add a single property, overwriting any existing property under the
47: * same key.
48: */
49: public Object addProperty(String key, Object value);
50:
51: /**
52: * Set loaded information into the given configuration.
53: */
54: public void setInto(Configuration conf);
55: }
|