org.apache.openjpa.lib.conf
Class MapConfigurationProvider

java.lang.Object
  extended by org.apache.openjpa.lib.conf.MapConfigurationProvider
All Implemented Interfaces:
ConfigurationProvider

public class MapConfigurationProvider
extends java.lang.Object
implements ConfigurationProvider

Simple configuration provider that sets configuration based on a provided map.

Author:
Abe White

Constructor Summary
MapConfigurationProvider()
          Construct with null properties.
MapConfigurationProvider(java.util.Map props)
          Constructor; supply properties map.
 
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.
protected  void setInto(Configuration conf, Log log)
          Set properties into configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapConfigurationProvider

public MapConfigurationProvider()
Construct with null properties.


MapConfigurationProvider

public MapConfigurationProvider(java.util.Map props)
Constructor; supply properties map.

Method Detail

loadDefaults

public boolean loadDefaults(java.lang.ClassLoader loader)
                     throws java.lang.Exception
Description copied from interface: ConfigurationProvider
Load defaults, or return false if no defaults for this provider found.

Specified by:
loadDefaults in interface ConfigurationProvider
Throws:
java.lang.Exception

load

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

Specified by:
load in interface ConfigurationProvider
Throws:
java.lang.Exception

load

public boolean load(java.io.File file)
             throws java.lang.Exception
Description copied from interface: ConfigurationProvider
Load given file, or return false if it is not a file this provider understands.

Specified by:
load in interface ConfigurationProvider
Throws:
java.lang.Exception

getProperties

public java.util.Map getProperties()
Description copied from interface: ConfigurationProvider
Return properties loaded thus far, or empty map if none.

Specified by:
getProperties in interface ConfigurationProvider

addProperties

public void addProperties(java.util.Map props)
Description copied from interface: ConfigurationProvider
Add the given properties to those in this provider, overwriting any exisitng properties under the same keys.

Specified by:
addProperties in interface ConfigurationProvider

addProperty

public java.lang.Object addProperty(java.lang.String key,
                                    java.lang.Object value)
Description copied from interface: ConfigurationProvider
Add a single property, overwriting any existing property under the same key.

Specified by:
addProperty in interface ConfigurationProvider

setInto

public void setInto(Configuration conf)
Description copied from interface: ConfigurationProvider
Set loaded information into the given configuration.

Specified by:
setInto in interface ConfigurationProvider

setInto

protected void setInto(Configuration conf,
                       Log log)
Set properties into configuration. If the log is non-null, will log a TRACE message about the set.



Copyright © 2006 Apache Software Foundation. All Rights Reserved.