*/
public synchronized SynchronizingStorageEngine register(String storeName,
Scope scope,
boolean persistent)
throws PersistException {
SynchronizingStorageEngine store =
localStores.get(storeName);
if (store != null) {
return store;
}
IStorageEngine<ByteArray, byte[]> dstore;
if (persistent) {
if (persistentDataSource == null)
persistentDataSource = JavaDBStorageEngine.getDataSource(dbPath, false);
dstore = new JavaDBStorageEngine(storeName, persistentDataSource);
} else {
dstore = new InMemoryStorageEngine<ByteArray, byte[]>(storeName);
}
store = new SynchronizingStorageEngine(dstore, syncManager,
syncManager.debugCounter,
scope);
localStores.put(storeName, store);
return store;
}