org.apache.openjpa.lib.conf
Interface ConfigurationProvider

All Known Implementing Classes:
MapConfigurationProvider

public interface ConfigurationProvider

Implementations of this interface can populate Configurations in some environment-specific way. Implementations must implement the equals and hashCode methods so that equivalent configurations compare equal.

Since:
4.0.0

Method Summary
 void addProperties(java.util.Map props)
          Add the given properties to those in this provider, overwriting any exisitng properties under the same keys.
 java.lang.Object addProperty(java.lang.String key, java.lang.Object value)
          Add a single property, overwriting any existing property under the same key.
 java.util.Map getProperties()
          Return properties loaded thus far, or empty map if none.
 boolean load(java.io.File file)
          Load given file, or return false if it is not a file this provider understands.
 boolean load(java.lang.String resource, java.lang.ClassLoader loader)
          Load the given given resource, or return false if it is not a resource this provider understands.
 boolean loadDefaults(java.lang.ClassLoader loader)
          Load defaults, or return false if no defaults for this provider found.
 void setInto(Configuration conf)
          Set loaded information into the given configuration.
 

Method Detail

loadDefaults

boolean loadDefaults(java.lang.ClassLoader loader)
                     throws java.lang.Exception
Load defaults, or return false if no defaults for this provider found.

Throws:
java.lang.Exception

load

boolean load(java.lang.String resource,
             java.lang.ClassLoader loader)
             throws java.lang.Exception
Load the given given resource, or return false if it is not a resource this provider understands. The given class loader may be null.

Throws:
java.lang.Exception

load

boolean load(java.io.File file)
             throws java.lang.Exception
Load given file, or return false if it is not a file this provider understands.

Throws:
java.lang.Exception

getProperties

java.util.Map getProperties()
Return properties loaded thus far, or empty map if none.


addProperties

void addProperties(java.util.Map props)
Add the given properties to those in this provider, overwriting any exisitng properties under the same keys.


addProperty

java.lang.Object addProperty(java.lang.String key,
                             java.lang.Object value)
Add a single property, overwriting any existing property under the same key.


setInto

void setInto(Configuration conf)
Set loaded information into the given configuration.



Copyright © 2006 Apache Software Foundation. All Rights Reserved.