public OpenJPAEntityManagerFactory createContainerEntityManagerFactory(
PersistenceUnitInfo pui, Map m) {
PersistenceProductDerivation pd = new PersistenceProductDerivation();
try {
Object poolValue = Configurations.removeProperty(EMF_POOL, m);
ConfigurationProvider cp = pd.load(pui, m);
if (cp == null)
return null;
// add enhancer
Exception transformerException = null;
String ctOpts = (String) Configurations.getProperty
(CLASS_TRANSFORMER_OPTIONS, pui.getProperties());
try {
pui.addTransformer(new ClassTransformerImpl(cp, ctOpts,
pui.getNewTempClassLoader(), newConfigurationImpl()));
} catch (Exception e) {
// fail gracefully
transformerException = e;
}
// if the BrokerImpl hasn't been specified, switch to the
// non-finalizing one, since anything claiming to be a container
// should be doing proper resource management.
if (!Configurations.containsProperty(BrokerValue.KEY,
cp.getProperties())) {
cp.addProperty("openjpa." + BrokerValue.KEY,
getDefaultBrokerAlias());
}
BrokerFactory factory = getBrokerFactory(cp, poolValue,
pui.getClassLoader());