org.apache.openjpa.persistence
Class ConfigurationProviderImpl

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

public class ConfigurationProviderImpl
extends org.apache.openjpa.lib.conf.MapConfigurationProvider

Configuration provider capable of loading a Configuration from the current environment's JPA-style XML configuration data. For defaults, looks in openjpa.properties system property for the location of a file to parse. If no system property is defined, the default resource location of openjpa.xml is used. If it exists, the resource is parsed as an XML file.

Since:
4.0.0

Constructor Summary
ConfigurationProviderImpl()
           
 
Method Summary
 java.lang.ClassLoader getClassLoader()
           
 boolean load(java.io.File file)
           
 boolean load(javax.persistence.spi.PersistenceUnitInfo pinfo)
          Load configuration from the given persistence unit with the specified user properties.
 boolean load(javax.persistence.spi.PersistenceUnitInfo pinfo, java.util.Map m)
          Load configuration from the given persistence unit with the specified user properties.
 boolean load(java.lang.String rsrc, java.lang.ClassLoader loader)
           
 boolean load(java.lang.String name, java.lang.String rsrc, java.util.Map m)
          Load configuration from the given resource, with the given map of overrides.
 boolean loadDefaults(java.lang.ClassLoader loader)
           
 void setInto(org.apache.openjpa.lib.conf.Configuration conf)
           
 
Methods inherited from class org.apache.openjpa.lib.conf.MapConfigurationProvider
addProperties, addProperty, getProperties, setInto
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationProviderImpl

public ConfigurationProviderImpl()
Method Detail

getClassLoader

public java.lang.ClassLoader getClassLoader()

load

public boolean load(javax.persistence.spi.PersistenceUnitInfo pinfo)
             throws java.io.IOException
Load configuration from the given persistence unit with the specified user properties.

Throws:
java.io.IOException

load

public boolean load(javax.persistence.spi.PersistenceUnitInfo pinfo,
                    java.util.Map m)
             throws java.io.IOException
Load configuration from the given persistence unit with the specified user properties.

Throws:
java.io.IOException

load

public boolean load(java.lang.String name,
                    java.lang.String rsrc,
                    java.util.Map m)
             throws java.io.IOException
Load configuration from the given resource, with the given map of overrides. If the resource is null, tries to load from persistence.xml, but still returns true if persistence.xml does not exist.

Throws:
java.io.IOException

loadDefaults

public boolean loadDefaults(java.lang.ClassLoader loader)
                     throws java.io.IOException
Specified by:
loadDefaults in interface org.apache.openjpa.lib.conf.ConfigurationProvider
Overrides:
loadDefaults in class org.apache.openjpa.lib.conf.MapConfigurationProvider
Throws:
java.io.IOException

load

public boolean load(java.lang.String rsrc,
                    java.lang.ClassLoader loader)
             throws java.io.IOException
Specified by:
load in interface org.apache.openjpa.lib.conf.ConfigurationProvider
Overrides:
load in class org.apache.openjpa.lib.conf.MapConfigurationProvider
Throws:
java.io.IOException

load

public boolean load(java.io.File file)
Specified by:
load in interface org.apache.openjpa.lib.conf.ConfigurationProvider
Overrides:
load in class org.apache.openjpa.lib.conf.MapConfigurationProvider

setInto

public void setInto(org.apache.openjpa.lib.conf.Configuration conf)
Specified by:
setInto in interface org.apache.openjpa.lib.conf.ConfigurationProvider
Overrides:
setInto in class org.apache.openjpa.lib.conf.MapConfigurationProvider


Copyright © 2006 Apache Software Foundation. All Rights Reserved.