OPENJPA-1237: allow customized MappingRepository

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@821236 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Fay Wang 2009-10-03 03:42:01 +00:00
parent 31c4790c32
commit 97aca65ddc
2 changed files with 10 additions and 1 deletions

View File

@ -86,6 +86,10 @@ public class JDBCBrokerFactory
super(conf);
}
public JDBCBrokerFactory(JDBCConfiguration conf, boolean earlyInit) {
super(conf, earlyInit);
}
public Map<String,Object> getProperties() {
// add platform property
Map<String,Object> props = super.getProperties();

View File

@ -150,10 +150,13 @@ public abstract class AbstractBrokerFactory
return (AbstractBrokerFactory) _pool.get(key);
}
protected AbstractBrokerFactory(OpenJPAConfiguration config) {
this(config, true);
}
/**
* Constructor. Configuration must be provided on construction.
*/
protected AbstractBrokerFactory(OpenJPAConfiguration config) {
protected AbstractBrokerFactory(OpenJPAConfiguration config, boolean earlyInit) {
_conf = config;
_brokers = newBrokerSet();
getPcClassLoaders();
@ -164,6 +167,8 @@ public abstract class AbstractBrokerFactory
_conf.getConnectionRetainModeConstant(), false).close();
}
if (!earlyInit)
return;
// This eager metadata loading is invoked at construction.
// It can not happen during the MetaDataRepository configuration because
// within a container environment an uninitialized repository must be passed