mirror of https://github.com/apache/openjpa.git
Move delegating store manager creation to a separate method
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@786340 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7f0b0234c0
commit
453a6a96fa
|
@ -217,16 +217,7 @@ public abstract class AbstractBrokerFactory
|
|||
assertOpen();
|
||||
makeReadOnly();
|
||||
|
||||
// decorate the store manager for data caching and custom
|
||||
// result object providers; always make sure it's a delegating
|
||||
// store manager, because it's easier for users to deal with
|
||||
// that way
|
||||
StoreManager sm = newStoreManager();
|
||||
DelegatingStoreManager dsm = null;
|
||||
if (_conf.getDataCacheManagerInstance().getSystemDataCache()
|
||||
!= null)
|
||||
dsm = new DataCacheStoreManager(sm);
|
||||
dsm = new ROPStoreManager((dsm == null) ? sm : dsm);
|
||||
DelegatingStoreManager dsm = createDelegatingStoreManager();
|
||||
|
||||
broker.initialize(this, dsm, managed, connRetainMode,
|
||||
fromDeserialization);
|
||||
|
@ -879,4 +870,26 @@ public abstract class AbstractBrokerFactory
|
|||
|
||||
return _pcClassLoaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a DelegatingStoreManager for use with a Broker created by this
|
||||
* factory.
|
||||
*
|
||||
* @return A DataCacheStoreManager if a DataCache is in use otherwise an
|
||||
* ROPStoreManager
|
||||
*/
|
||||
protected DelegatingStoreManager createDelegatingStoreManager() {
|
||||
// decorate the store manager for data caching and custom
|
||||
// result object providers; always make sure it's a delegating
|
||||
// store manager, because it's easier for users to deal with
|
||||
// that way
|
||||
StoreManager sm = newStoreManager();
|
||||
DelegatingStoreManager dsm = null;
|
||||
if (_conf.getDataCacheManagerInstance().getSystemDataCache()
|
||||
!= null)
|
||||
dsm = new DataCacheStoreManager(sm);
|
||||
dsm = new ROPStoreManager((dsm == null) ? sm : dsm);
|
||||
|
||||
return dsm;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue