[New][Backport] Implemented async parallel loading from pageable persistence layers

This commit is contained in:
Robert von Burg 2022-11-22 13:45:14 +01:00
parent 5195b45401
commit af772d6baa
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
9 changed files with 368 additions and 225 deletions

View File

@ -15,20 +15,15 @@
*/
package li.strolch.agent.impl;
import java.text.MessageFormat;
import java.util.List;
import java.util.Set;
import li.strolch.agent.api.*;
import li.strolch.model.Order;
import li.strolch.model.Resource;
import li.strolch.model.activity.Activity;
import li.strolch.persistence.api.*;
import li.strolch.agent.api.AuditTrail;
import li.strolch.agent.api.ComponentContainer;
import li.strolch.agent.api.StrolchAgent;
import li.strolch.persistence.api.PersistenceHandler;
import li.strolch.persistence.api.StrolchTransaction;
import li.strolch.privilege.model.Certificate;
import li.strolch.privilege.model.PrivilegeContext;
import li.strolch.runtime.configuration.ComponentConfiguration;
import li.strolch.utils.dbc.DBC;
import li.strolch.utils.helper.StringHelper;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
@ -63,17 +58,17 @@ public class CachedRealm extends InternalStrolchRealm {
}
@Override
public ResourceMap getResourceMap() {
public CachedResourceMap getResourceMap() {
return this.resourceMap;
}
@Override
public OrderMap getOrderMap() {
public CachedOrderMap getOrderMap() {
return this.orderMap;
}
@Override
public ActivityMap getActivityMap() {
public CachedActivityMap getActivityMap() {
return this.activityMap;
}
@ -82,6 +77,10 @@ public class CachedRealm extends InternalStrolchRealm {
return this.auditTrail;
}
StrolchAgent getAgent() {
return this.container.getAgent();
}
@Override
public void initialize(ComponentContainer container, ComponentConfiguration configuration) {
super.initialize(container, configuration);
@ -100,69 +99,7 @@ public class CachedRealm extends InternalStrolchRealm {
@Override
public void start(PrivilegeContext privilegeContext) {
super.start(privilegeContext);
long start = System.nanoTime();
int nrOfOrders = 0;
int nrOfResources = 0;
int nrOfActivities = 0;
logger.info(MessageFormat.format("Loading Model from Database for realm {0}...", getRealm())); //$NON-NLS-1$
try (StrolchTransaction tx = openTx(privilegeContext.getCertificate(), "strolch_boot", false)) {
ResourceDao resourceDao = tx.getPersistenceHandler().getResourceDao(tx);
logger.info("Reading " + resourceDao.querySize() + " Resources from DB...");
Set<String> resourceTypes = resourceDao.queryTypes();
for (String type : resourceTypes) {
logger.info("Reading " + resourceDao.querySize(type) + " Resources of type " + type + " from DB...");
List<Resource> resources = resourceDao.queryAll(type);
for (Resource resource : resources) {
this.resourceMap.insert(resource);
nrOfResources++;
}
}
tx.commitOnClose();
}
try (StrolchTransaction tx = openTx(privilegeContext.getCertificate(), "strolch_boot", false)) {
OrderDao orderDao = tx.getPersistenceHandler().getOrderDao(tx);
logger.info("Reading " + orderDao.querySize() + " Orders from DB...");
Set<String> orderTypes = orderDao.queryTypes();
for (String type : orderTypes) {
logger.info("Reading " + orderDao.querySize(type) + " Orders of type " + type + " from DB...");
List<Order> orders = orderDao.queryAll(type);
for (Order order : orders) {
this.orderMap.insert(order);
nrOfOrders++;
}
}
tx.commitOnClose();
}
try (StrolchTransaction tx = openTx(privilegeContext.getCertificate(), "strolch_boot", false)) {
ActivityDao activityDao = tx.getPersistenceHandler().getActivityDao(tx);
logger.info("Reading " + activityDao.querySize() + " Activities from DB...");
Set<String> activityTypes = activityDao.queryTypes();
for (String type : activityTypes) {
logger.info("Reading " + activityDao.querySize(type) + " Activities of type " + type + " from DB...");
List<Activity> activities = activityDao.queryAll(type);
for (Activity activity : activities) {
this.activityMap.insert(activity);
nrOfActivities++;
}
}
tx.commitOnClose();
}
long duration = System.nanoTime() - start;
String durationS = StringHelper.formatNanoDuration(duration);
logger.info(MessageFormat
.format("Loading Model from Database for realm {0} took {1}.", getRealm(), durationS)); //$NON-NLS-1$
logger.info(MessageFormat.format("Loaded {0} Orders", nrOfOrders)); //$NON-NLS-1$
logger.info(MessageFormat.format("Loaded {0} Resources", nrOfResources)); //$NON-NLS-1$
logger.info(MessageFormat.format("Loaded {0} Activities", nrOfActivities)); //$NON-NLS-1$
new CachedRealmLoader(this, this.persistenceHandler, privilegeContext).load(getRealm());
}
@Override

View File

@ -0,0 +1,178 @@
package li.strolch.agent.impl;
import static java.lang.Integer.MAX_VALUE;
import static java.util.concurrent.CompletableFuture.allOf;
import static java.util.concurrent.CompletableFuture.supplyAsync;
import static java.util.concurrent.TimeUnit.SECONDS;
import java.text.MessageFormat;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Function;
import java.util.function.Supplier;
import li.strolch.model.StrolchRootElement;
import li.strolch.persistence.api.PersistenceHandler;
import li.strolch.persistence.api.StrolchDao;
import li.strolch.persistence.api.StrolchTransaction;
import li.strolch.privilege.model.Certificate;
import li.strolch.privilege.model.PrivilegeContext;
import li.strolch.utils.dbc.DBC;
import li.strolch.utils.helper.StringHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CachedRealmLoader {
private static final Logger logger = LoggerFactory.getLogger(CachedRealmLoader.class);
public static final int MIN_PAGE_SIZE = 200;
private final CachedRealm realm;
private final PersistenceHandler persistenceHandler;
private final PrivilegeContext privilegeContext;
private final AtomicLong nrOfOrders;
private final AtomicLong nrOfResources;
private final AtomicLong nrOfActivities;
public CachedRealmLoader(CachedRealm realm, PersistenceHandler persistenceHandler,
PrivilegeContext privilegeContext) {
this.realm = realm;
this.persistenceHandler = persistenceHandler;
this.privilegeContext = privilegeContext;
this.nrOfOrders = new AtomicLong();
this.nrOfResources = new AtomicLong();
this.nrOfActivities = new AtomicLong();
}
public void load(String realm) {
long start = System.nanoTime();
logger.info(MessageFormat.format("Loading Model from Database for realm {0}...", realm));
if (this.persistenceHandler.supportsPaging()) {
loadElementsPagingAsync("Resources", this.persistenceHandler::getResourceDao, this.realm::getResourceMap,
this.nrOfResources);
loadElementsPagingAsync("Orders", this.persistenceHandler::getOrderDao, this.realm::getOrderMap,
this.nrOfOrders);
loadElementsPagingAsync("Activities", this.persistenceHandler::getActivityDao, this.realm::getActivityMap,
this.nrOfActivities);
} else {
loadElements("Resources", this.persistenceHandler::getResourceDao, this.realm::getResourceMap,
this.nrOfResources);
loadElements("Orders", this.persistenceHandler::getOrderDao, this.realm::getOrderMap, this.nrOfOrders);
loadElements("Activities", this.persistenceHandler::getActivityDao, this.realm::getActivityMap,
this.nrOfActivities);
}
long duration = System.nanoTime() - start;
String durationS = StringHelper.formatNanoDuration(duration);
logger.info(MessageFormat.format("Loading Model from Database for realm {0} took {1}.", realm, durationS));
logger.info(MessageFormat.format("Loaded {0} Orders", this.nrOfOrders));
logger.info(MessageFormat.format("Loaded {0} Resources", this.nrOfResources));
logger.info(MessageFormat.format("Loaded {0} Activities", this.nrOfActivities));
}
private <T extends StrolchRootElement> void loadElements(String context,
Function<StrolchTransaction, StrolchDao<T>> daoSupplier, Supplier<CachedElementMap<T>> elementMapSupplier,
AtomicLong counter) {
long start = System.nanoTime();
long nrOfElements;
CachedElementMap<T> elementMap = elementMapSupplier.get();
try (StrolchTransaction tx = this.realm.openTx(getCert(), "strolch_boot_" + context, false)) {
StrolchDao<T> dao = daoSupplier.apply(tx);
nrOfElements = dao.querySize();
logger.info("Loading " + nrOfElements + " " + context + " from DB...");
Set<String> types = dao.queryTypes();
for (String type : types) {
long sizeOfType = dao.querySize(type);
logger.info("Loading " + sizeOfType + " " + context + " of type " + type + " from DB...");
List<T> elements = dao.queryAll(type);
elementMap.insertAll(elements);
counter.addAndGet(elements.size());
}
tx.commitOnClose();
}
String durationS = StringHelper.formatNanoDuration(System.nanoTime() - start);
logger.info(MessageFormat.format("Loading of {0} {1} took {2}.", nrOfElements, context, durationS));
}
private <T extends StrolchRootElement> void loadElementsPagingAsync(String context,
Function<StrolchTransaction, StrolchDao<T>> daoSupplier, Supplier<CachedElementMap<T>> elementMapSupplier,
AtomicLong counter) {
long start = System.nanoTime();
Map<String, Long> sizeByTypes = getSizesByType(daoSupplier);
CachedElementMap<T> elementMap = elementMapSupplier.get();
long nrOfElements = sizeByTypes.values().stream().mapToLong(Long::longValue).sum();
logger.info("Loading " + nrOfElements + " " + context + " from DB...");
List<CompletableFuture<List<T>>> tasks = new ArrayList<>();
sizeByTypes.keySet().stream().sorted(Comparator.comparing(sizeByTypes::get)).forEach(type -> {
long size = sizeByTypes.get(type);
if (size < MIN_PAGE_SIZE) {
logger.info("Loading " + size + " " + context + " of type " + type + " from DB async in parallel...");
tasks.add(supplyAsync(() -> loadPage(daoSupplier, type, MAX_VALUE, 0)));
} else {
long pageSize = Math.max(MIN_PAGE_SIZE, size / Runtime.getRuntime().availableProcessors());
logger.info("Loading " + size + " " + context + " of type " + type + " in pages of " + pageSize
+ " from DB async in parallel...");
long position = 0;
while (position < size) {
long offset = position;
tasks.add(supplyAsync(() -> loadPage(daoSupplier, type, pageSize, offset)));
position += pageSize;
}
}
});
// wait for all tasks to complete
Throwable failureEx = allOf(tasks.toArray(new CompletableFuture[0])).handle((u, t) -> t).join();
if (failureEx != null)
throw new IllegalStateException("Failed to load " + context, failureEx);
// now insert elements into element map
tasks.stream().map(CompletableFuture::join).forEach(elements -> {
elementMap.insertAll(elements);
counter.addAndGet(elements.size());
});
DBC.POST.assertEquals("Expected size should be same as counter", nrOfElements, counter.get());
String durationS = StringHelper.formatNanoDuration(System.nanoTime() - start);
logger.info(MessageFormat.format("Loading of {0} {1} took {2}.", counter, context, durationS));
}
private <T extends StrolchRootElement> List<T> loadPage(Function<StrolchTransaction, StrolchDao<T>> daoSupplier,
String type, long pageSize, long offset) {
try (StrolchTransaction tx = this.realm.openTx(getCert(), "strolch_boot", true)
.silentThreshold(10, SECONDS)
.suppressUpdates()) {
return daoSupplier.apply(tx).queryAll(pageSize, offset, type);
}
}
private <T extends StrolchRootElement> Map<String, Long> getSizesByType(
Function<StrolchTransaction, StrolchDao<T>> daoSupplier) {
Map<String, Long> sizeByTypes = new HashMap<>();
try (StrolchTransaction tx = this.realm.openTx(getCert(), "strolch_boot", true).silentThreshold(10, SECONDS)) {
StrolchDao<T> dao = daoSupplier.apply(tx);
Set<String> types = dao.queryTypes();
for (String type : types) {
sizeByTypes.put(type, dao.querySize(type));
}
}
return sizeByTypes;
}
private Certificate getCert() {
return this.privilegeContext.getCertificate();
}
}

View File

@ -44,6 +44,7 @@ public abstract class InternalStrolchRealm implements StrolchRealm {
private boolean versioningEnabled;
private boolean updateObservers;
private ObserverHandler observerHandler;
protected ComponentContainer container;
public InternalStrolchRealm(String realm) {

View File

@ -244,11 +244,14 @@ public abstract class TransientElementMap<T extends StrolchRootElement> implemen
* Special method used when starting the container to cache the values. Not to be used anywhere else but from the
* {@link CachedRealm}
*
* @param element
* the element to insert
* @param elements
* the elements to insert
*/
synchronized void insert(T element) {
synchronized void insertAll(List<T> elements) {
elements.forEach(this::internalInsert);
}
private void internalInsert(T element) {
Map<String, T> byType = this.elementMap.computeIfAbsent(element.getType(), k -> new HashMap<>());
// assert no object already exists with this id
@ -274,19 +277,7 @@ public abstract class TransientElementMap<T extends StrolchRootElement> implemen
if (!element.hasVersion())
Version.setInitialVersionFor(element, tx.getCertificate().getUsername());
Map<String, T> byType = this.elementMap.computeIfAbsent(element.getType(), k -> new HashMap<>());
// assert no object already exists with this id
if (byType.containsKey(element.getId())) {
String msg = "An element already exists with the id \"{0}\". Elements of the same class must always have a unique id, regardless of their type!"; //$NON-NLS-1$
msg = MessageFormat.format(msg, element.getId());
throw new StrolchPersistenceException(msg);
}
byType.put(element.getId(), element);
// now make read only
element.setReadOnly();
internalInsert(element);
}
@Override

View File

@ -233,6 +233,12 @@ public abstract class AbstractTransaction implements StrolchTransaction {
return TimeUnit.NANOSECONDS.toMillis(this.silentThreshold);
}
@Override
public StrolchTransaction suppressUpdates() {
this.suppressUpdates = true;
return this;
}
@Override
public void setSuppressUpdates(boolean suppressUpdates) {
this.suppressUpdates = suppressUpdates;

View File

@ -27,6 +27,11 @@ import li.strolch.privilege.model.Certificate;
*/
public interface PersistenceHandler {
/**
* Returns true if this persistence layer supports paging, i.e. the DAO methods with a limit and offset may be used
*/
boolean supportsPaging();
/**
* Opens a {@link StrolchTransaction} on the given {@link StrolchRealm}. The transaction is the main object to be
* used when accessing and modifying the elements of a realm.

View File

@ -206,9 +206,9 @@ public interface StrolchTransaction extends AutoCloseable {
long getActivityCount(String type);
/**
* Returns the {@link PersistenceHandler}. If the {@link StrolchRealm} is not running in {@link
* DataStoreMode#TRANSIENT} mode, then the {@link PersistenceHandler} will be a {@link StrolchComponent}, otherwise
* it will be the internal in memory persistence handler
* Returns the {@link PersistenceHandler}. If the {@link StrolchRealm} is not running in
* {@link DataStoreMode#TRANSIENT} mode, then the {@link PersistenceHandler} will be a {@link StrolchComponent},
* otherwise it will be the internal in memory persistence handler
*
* @return the {@link PersistenceHandler}
*/
@ -332,8 +332,9 @@ public interface StrolchTransaction extends AutoCloseable {
* </p>
* <p>
* <code>
* StrolchAgent strolchAgent = getStrolchAgent(); StrolchRealm realm = strolchAgent.getContainer().getRealm("defaultRealm");
* try(StrolchTransaction tx = realm.openTx(certificate, getClass())){ // do work tx.commitOnClose(); }
* StrolchAgent strolchAgent = getStrolchAgent(); StrolchRealm realm =
* strolchAgent.getContainer().getRealm("defaultRealm"); try(StrolchTransaction tx = realm.openTx(certificate,
* getClass())){ // do work tx.commitOnClose(); }
* </code>
* <p>
* After the block is closed, the transaction is automatically closed and all allocated resources are released
@ -362,8 +363,8 @@ public interface StrolchTransaction extends AutoCloseable {
StrolchTransaction rollbackOnClose();
/**
* Sets the {@link TransactionCloseStrategy} to {@link TransactionCloseStrategy#ROLLBACK} and returns a {@link
* StrolchTransactionException} which can be thrown by the caller to stop the exception
* Sets the {@link TransactionCloseStrategy} to {@link TransactionCloseStrategy#ROLLBACK} and returns a
* {@link StrolchTransactionException} which can be thrown by the caller to stop the exception
*
* @param exceptionMessage
* the message with which this TX has failed
@ -407,7 +408,8 @@ public interface StrolchTransaction extends AutoCloseable {
boolean isOpen();
/**
* @return if the current state of the StrolchTransaction is {@link TransactionCloseStrategy#READ_ONLY} or {@link TransactionCloseStrategy#ROLLBACK}
* @return if the current state of the StrolchTransaction is {@link TransactionCloseStrategy#READ_ONLY} or
* {@link TransactionCloseStrategy#ROLLBACK}
*/
boolean isReadOnly();
@ -458,6 +460,11 @@ public interface StrolchTransaction extends AutoCloseable {
*/
long getSilentThreshold();
/**
* Suppresses the updates of observer
*/
StrolchTransaction suppressUpdates();
/**
* If the given argument is true, then no observer updates are performed
*
@ -597,8 +604,8 @@ public interface StrolchTransaction extends AutoCloseable {
void add(Command command);
/**
* Helper method to create an {@link Audit} with the given arguments. The audit can then be saved by calling {@link
* AuditTrail#add(StrolchTransaction, Audit)}
* Helper method to create an {@link Audit} with the given arguments. The audit can then be saved by calling
* {@link AuditTrail#add(StrolchTransaction, Audit)}
*
* @param accessType
* the type of access
@ -614,8 +621,8 @@ public interface StrolchTransaction extends AutoCloseable {
Audit auditFrom(AccessType accessType, String elementType, String elementSubType, String id);
/**
* Helper method to create an {@link Audit} with the given arguments. The audit can then be saved by calling {@link
* AuditTrail#add(StrolchTransaction, Audit)}
* Helper method to create an {@link Audit} with the given arguments. The audit can then be saved by calling
* {@link AuditTrail#add(StrolchTransaction, Audit)}
*
* @param accessType
* the type of access
@ -649,8 +656,8 @@ public interface StrolchTransaction extends AutoCloseable {
* </p>
*
* <p>
* This method can also be used to find a deeper element, e.g. a specific {@link Parameter} on an {@link
* ParameterBag} on an {@link Order}. This would be done as follows: <i>Order/MyType/Bag/@1/myParam</i>
* This method can also be used to find a deeper element, e.g. a specific {@link Parameter} on an
* {@link ParameterBag} on an {@link Order}. This would be done as follows: <i>Order/MyType/Bag/@1/myParam</i>
* </p>
*
* @param locator
@ -673,8 +680,8 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* <p>Finds a parameter with the {@link StrolchConstants#BAG_PARAMETERS} and @paramKey on the given @element, but
* if it does not exists on the element, then it retrieves the elements parent by using the bag {@link
* StrolchModelConstants#BAG_RELATIONS} and the param @parentParamKey.</p>
* if it does not exists on the element, then it retrieves the elements parent by using the bag
* {@link StrolchModelConstants#BAG_RELATIONS} and the param @parentParamKey.</p>
*
* <p>In Strolch relationships are usually defined on the parameter bag with the id {@link
* StrolchModelConstants#BAG_RELATIONS}</p>
@ -693,8 +700,8 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* <p>Finds a parameter with the given @bagKey and @paramKey on the given @element, but if it does not exists
* on the element, then it retrieves the elements parent by using the bag {@link
* StrolchModelConstants#BAG_RELATIONS} and the param @parentParamKey.</p>
* on the element, then it retrieves the elements parent by using the bag
* {@link StrolchModelConstants#BAG_RELATIONS} and the param @parentParamKey.</p>
*
* <p>In Strolch relationships are usually defined on the parameter bag with the id {@link
* StrolchModelConstants#BAG_RELATIONS}</p>
@ -750,10 +757,11 @@ public interface StrolchTransaction extends AutoCloseable {
* </p>
*
* <p>
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link
* StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when
* creating a {@link Resource} of type {@code Person} then having a template with the id {@code Person} helps
* creating new Person resources; get the resource and then create a clone: {@link Resource#getClone()}
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type
* {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For
* instance when creating a {@link Resource} of type {@code Person} then having a template with the id
* {@code Person} helps creating new Person resources; get the resource and then create a clone:
* {@link Resource#getClone()}
* </p>
*
* @param type
@ -770,10 +778,11 @@ public interface StrolchTransaction extends AutoCloseable {
* </p>
*
* <p>
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link
* StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when
* creating a {@link Resource} of type {@code Person} then having a template with the id {@code Person} helps
* creating new Person resources; get the resource and then create a clone: {@link Resource#getClone()}
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type
* {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For
* instance when creating a {@link Resource} of type {@code Person} then having a template with the id
* {@code Person} helps creating new Person resources; get the resource and then create a clone:
* {@link Resource#getClone()}
* </p>
*
* @param type
@ -820,10 +829,11 @@ public interface StrolchTransaction extends AutoCloseable {
* </p>
*
* <p>
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link
* StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when
* creating an {@link Order} of type {@code PurchaseOrder} then having a template with the id {@code PurchaseOrder}
* helps creating new PurchaseOrder orders; get the order and then create a clone: {@link Order#getClone()}
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type
* {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For
* instance when creating an {@link Order} of type {@code PurchaseOrder} then having a template with the id
* {@code PurchaseOrder} helps creating new PurchaseOrder orders; get the order and then create a clone:
* {@link Order#getClone()}
* </p>
*
* @param type
@ -840,10 +850,11 @@ public interface StrolchTransaction extends AutoCloseable {
* </p>
*
* <p>
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link
* StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when
* creating an {@link Order} of type {@code PurchaseOrder} then having a template with the id {@code PurchaseOrder}
* helps creating new PurchaseOrder orders; get the order and then create a clone: {@link Order#getClone()}
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type
* {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For
* instance when creating an {@link Order} of type {@code PurchaseOrder} then having a template with the id
* {@code PurchaseOrder} helps creating new PurchaseOrder orders; get the order and then create a clone:
* {@link Order#getClone()}
* </p>
*
* @param type
@ -864,10 +875,11 @@ public interface StrolchTransaction extends AutoCloseable {
* </p>
*
* <p>
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link
* StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when
* creating a {@link Activity} of type {@code ToStock} then having a template with the id {@code ToStock} helps
* creating new ToStock activities; get the activity and then create a clone: {@link Activity#getClone()}
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type
* {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For
* instance when creating a {@link Activity} of type {@code ToStock} then having a template with the id
* {@code ToStock} helps creating new ToStock activities; get the activity and then create a clone:
* {@link Activity#getClone()}
* </p>
*
* @param type
@ -884,10 +896,11 @@ public interface StrolchTransaction extends AutoCloseable {
* </p>
*
* <p>
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link
* StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when
* creating a {@link Activity} of type {@code ToStock} then having a template with the id {@code ToStock} helps
* creating new ToStock activities; get the activity and then create a clone: {@link Activity#getClone()}
* Templates are {@link StrolchRootElement StrolchRootElements} which have the type
* {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For
* instance when creating a {@link Activity} of type {@code ToStock} then having a template with the id
* {@code ToStock} helps creating new ToStock activities; get the activity and then create a clone:
* {@link Activity#getClone()}
* </p>
*
* @param type
@ -931,9 +944,9 @@ public interface StrolchTransaction extends AutoCloseable {
Resource getResourceBy(String type, String id, boolean assertExists) throws StrolchException;
/**
* Returns the {@link Resource} which is referenced by the given {@link StringParameter}. A reference {@link
* Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the
* UOM must be set to the resource's type and the value is the id of the resource
* Returns the {@link Resource} which is referenced by the given {@link StringParameter}. A reference
* {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF}
* and the UOM must be set to the resource's type and the value is the id of the resource
*
* @param refP
* the {@link StringParameter} which references a {@link Resource}
@ -946,9 +959,9 @@ public interface StrolchTransaction extends AutoCloseable {
Resource getResourceBy(StringParameter refP) throws StrolchException;
/**
* Returns the {@link Resource} which is referenced by the given {@link StringParameter}. A reference {@link
* Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the
* UOM must be set to the resource's type and the value is the id of the resource
* Returns the {@link Resource} which is referenced by the given {@link StringParameter}. A reference
* {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF}
* and the UOM must be set to the resource's type and the value is the id of the resource
*
* @param refP
* the {@link StringParameter} which references a {@link Resource}
@ -1000,16 +1013,16 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns the {@link Resource} which is referenced by the given {@link StrolchRootElement}. The element must have a
* {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it
* with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the value
* is the id of the resource to return
* with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the
* value is the id of the resource to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Resource} through a {@link StringParameter} with the
* given refId
* @param refId
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
*
* @return the resource referenced by the element, or null if the {@link ParameterBag}, {@link StringParameter} or
* referenced element do not exist
@ -1022,16 +1035,16 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns the {@link Resource} which is referenced by the given {@link StrolchRootElement}. The element must have a
* {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it
* with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the value
* is the id of the resource to return
* with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the
* value is the id of the resource to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Resource} through a {@link StringParameter} with the
* given refId
* @param refId
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
* @param assertExists
* if true, and referenced resource does not exist, then a {@link StrolchException} is thrown
*
@ -1046,17 +1059,17 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns all {@link Resource Resources} which are referenced by the given {@link StrolchRootElement}. The element
* must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link
* StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the value
* is the id of the resource to return
* must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a
* {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the
* value is the id of the resource to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Resource} through a {@link StringListParameter} with
* the given refId
* @param refId
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
*
* @return the resources referenced by the element, or null if the {@link ParameterBag}, {@link StringListParameter}
* or referenced element do not exist
@ -1068,17 +1081,17 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns all {@link Resource Resources} which are referenced by the given {@link StrolchRootElement}. The element
* must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link
* StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the value
* is the id of the resource to return
* must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a
* {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the
* value is the id of the resource to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Resource} through a {@link StringListParameter} with
* the given refId
* @param refId
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
* @param assertExists
* if true, and referenced resource does not exist, then a {@link StrolchException} is thrown
*
@ -1155,9 +1168,9 @@ public interface StrolchTransaction extends AutoCloseable {
Activity getActivityBy(String type, String id, boolean assertExists) throws StrolchException;
/**
* Returns the {@link Activity} which is referenced by the given {@link StringParameter}. A reference {@link
* Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the
* UOM must be set to the activity's type and the value is the id of the activity
* Returns the {@link Activity} which is referenced by the given {@link StringParameter}. A reference
* {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF}
* and the UOM must be set to the activity's type and the value is the id of the activity
*
* @param refP
* the {@link StringParameter} which references an {@link Activity}
@ -1170,9 +1183,9 @@ public interface StrolchTransaction extends AutoCloseable {
Activity getActivityBy(StringParameter refP) throws StrolchException;
/**
* Returns the {@link Activity} which is referenced by the given {@link StringParameter}. A reference {@link
* Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the
* UOM must be set to the activity's type and the value is the id of the activity
* Returns the {@link Activity} which is referenced by the given {@link StringParameter}. A reference
* {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF}
* and the UOM must be set to the activity's type and the value is the id of the activity
*
* @param refP
* the {@link StringParameter} which references an {@link Activity}
@ -1189,8 +1202,9 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns all {@link Activity Activities} which are referenced by the given {@link StringListParameter}. A
* reference {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF}
* and the UOM must be set to the activity's type and the value is the id of the activity
* reference {@link Parameter} must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the
* value is the id of the activity
*
* @param refP
* the {@link StringListParameter} which references a list of {@link Activity Activities}
@ -1205,8 +1219,9 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns all {@link Activity Activities} which are referenced by the given {@link StringListParameter}. A
* reference {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF}
* and the UOM must be set to the activity's type and the value is the id of the activity
* reference {@link Parameter} must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the
* value is the id of the activity
*
* @param refP
* the {@link StringListParameter} which references a list of {@link Activity Activities}
@ -1224,16 +1239,16 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns the {@link Activity} which is referenced by the given {@link StrolchRootElement}. The element must have a
* {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it
* with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the value
* is the id of the activity to return
* with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the
* value is the id of the activity to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Activity} through a {@link StringParameter} with the
* given refId
* @param refId
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
*
* @return the activity referenced by the element, or null if the {@link ParameterBag}, {@link StringParameter} or
* referenced element do not exist
@ -1246,16 +1261,16 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns the {@link Activity} which is referenced by the given {@link StrolchRootElement}. The element must have a
* {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it
* with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the value
* is the id of the activity to return
* with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the
* value is the id of the activity to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Activity} through a {@link StringParameter} with the
* given refId
* @param refId
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
* @param assertExists
* if true, and referenced order does not exist, then a {@link StrolchException} is thrown
*
@ -1270,17 +1285,17 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns all {@link Activity Activities} which are referenced by the given {@link StrolchRootElement}. The element
* must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link
* StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the values
* are the ids of the activities to return
* must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a
* {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the
* values are the ids of the activities to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Activity} through a {@link StringListParameter} with
* the given refId
* @param refId
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
*
* @return the activity referenced by the element, or null if the {@link ParameterBag}, {@link StringListParameter}
* or referenced element do not exist
@ -1292,22 +1307,22 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns all {@link Activity Activities} which are referenced by the given {@link StrolchRootElement}. The element
* must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link
* StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the values
* are the ids of the activities to return
* must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a
* {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the
* values are the ids of the activities to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Activity} through a {@link StringListParameter} with
* the given refId
* @param refId
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
* @param assertExists
* if true, and referenced order does not exist, then a {@link StrolchException} is thrown
*
* @return the activities referenced by the element, or null if the {@link ParameterBag}, {@link
* StringListParameter} or referenced element do not exist
* @return the activities referenced by the element, or null if the {@link ParameterBag},
* {@link StringListParameter} or referenced element do not exist
*
* @throws StrolchException
* if the {@link StringListParameter} is not a properly configured as a reference parameter
@ -1414,16 +1429,16 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns the {@link Order} which is referenced by the given {@link StrolchRootElement}. The element must have a
* {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it
* with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the value is the
* id of the order to return
* with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the value
* is the id of the order to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Order} through a {@link StringParameter} with the
* given refId
* @param refId
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
*
* @return the order referenced by the element, or null if the {@link ParameterBag}, {@link StringParameter} or
* referenced element do not exist
@ -1436,16 +1451,16 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns the {@link Order} which is referenced by the given {@link StrolchRootElement}. The element must have a
* {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it
* with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the value is the
* id of the order to return
* with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the value
* is the id of the order to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Order} through a {@link StringParameter} with the
* given refId
* @param refId
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
* @param assertExists
* if true, and referenced order does not exist, then a {@link StrolchException} is thrown
*
@ -1459,17 +1474,17 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns all {@link Order Orders} which are referenced by the given {@link StrolchRootElement}. The element must
* have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link
* StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the values are
* the ids of the orders to return
* have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a
* {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the values
* are the ids of the orders to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Order} through a {@link StringListParameter} with the
* given refId
* @param refId
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
*
* @return the orders referenced by the element, or null if the {@link ParameterBag}, {@link StringListParameter} or
* referenced element do not exist
@ -1481,17 +1496,17 @@ public interface StrolchTransaction extends AutoCloseable {
/**
* Returns all {@link Order Orders} which are referenced by the given {@link StrolchRootElement}. The element must
* have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link
* StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link
* StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the values are
* the ids of the orders to return
* have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a
* {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to
* {@link StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the values
* are the ids of the orders to return
*
* @param element
* the {@link StrolchRootElement} which references a {@link Order} through a {@link StringListParameter} with the
* given refId
* @param refId
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link
* StrolchModelConstants#BAG_RELATIONS}
* the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id
* {@link StrolchModelConstants#BAG_RELATIONS}
* @param assertExists
* if true, and referenced order does not exist, then a {@link StrolchException} is thrown
*

View File

@ -55,6 +55,11 @@ public class PostgreSqlPersistenceHandler extends StrolchComponent implements Pe
super(container, componentName);
}
@Override
public boolean supportsPaging() {
return true;
}
public DataType getDataType() {
return this.dataType;
}
@ -93,8 +98,8 @@ public class PostgreSqlPersistenceHandler extends StrolchComponent implements Pe
boolean allowSchemaCreation = configuration.getBoolean(PROP_ALLOW_SCHEMA_CREATION, Boolean.FALSE);
boolean allowSchemaMigration = configuration.getBoolean(PROP_ALLOW_SCHEMA_MIGRATION, Boolean.FALSE);
boolean allowSchemaDrop = configuration.getBoolean(PROP_ALLOW_SCHEMA_DROP, Boolean.FALSE);
boolean allowDataInitOnSchemaCreate = configuration
.getBoolean(PROP_ALLOW_DATA_INIT_ON_SCHEMA_CREATE, Boolean.FALSE);
boolean allowDataInitOnSchemaCreate = configuration.getBoolean(PROP_ALLOW_DATA_INIT_ON_SCHEMA_CREATE,
Boolean.FALSE);
DbSchemaVersionCheck schemaVersionCheck = new DbSchemaVersionCheck(SCRIPT_PREFIX_STROLCH, this.getClass(),
allowSchemaCreation, allowSchemaMigration, allowSchemaDrop);
@ -140,8 +145,8 @@ public class PostgreSqlPersistenceHandler extends StrolchComponent implements Pe
public Connection getConnection(String realm) {
DataSource ds = this.dsMap.get(realm);
if (ds == null) {
String msg = MessageFormat
.format("There is no DataSource registered for the realm {0}", realm); //$NON-NLS-1$
String msg = MessageFormat.format("There is no DataSource registered for the realm {0}",
realm); //$NON-NLS-1$
throw new StrolchPersistenceException(msg);
}

View File

@ -27,13 +27,13 @@ import li.strolch.agent.api.RealmHandler;
import li.strolch.agent.api.StrolchComponent;
import li.strolch.agent.api.StrolchRealm;
import li.strolch.agent.impl.StoreToDaoElementListener;
import li.strolch.model.log.LogMessage;
import li.strolch.model.ModelStatistics;
import li.strolch.model.Order;
import li.strolch.model.Resource;
import li.strolch.model.Tags;
import li.strolch.model.activity.Activity;
import li.strolch.model.audit.Audit;
import li.strolch.model.log.LogMessage;
import li.strolch.model.xml.XmlModelSaxFileReader;
import li.strolch.persistence.api.*;
import li.strolch.persistence.xml.model.*;
@ -60,6 +60,11 @@ public class XmlPersistenceHandler extends StrolchComponent implements Persisten
super(container, componentName);
}
@Override
public boolean supportsPaging() {
return false;
}
@Override
public void initialize(ComponentConfiguration configuration) throws Exception {
@ -140,8 +145,8 @@ public class XmlPersistenceHandler extends StrolchComponent implements Persisten
logger.info("Initializing realm " + realmName + " as DB is empty.");
StrolchConfiguration strolchConfiguration = getContainer().getAgent().getStrolchConfiguration();
ComponentConfiguration realmConfiguration = strolchConfiguration
.getComponentConfiguration(RealmHandler.class.getSimpleName());
ComponentConfiguration realmConfiguration = strolchConfiguration.getComponentConfiguration(
RealmHandler.class.getSimpleName());
String dataStoreKey = makeRealmKey(realmName, PREFIX_DATA_STORE_FILE);
RuntimeConfiguration runtimeConfiguration = strolchConfiguration.getRuntimeConfiguration();
File dataStoreF = realmConfiguration.getDataFile(dataStoreKey, null, runtimeConfiguration, true);