X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=source%2Fmir%2Fentity%2FEntityList.java;h=b2fc95ba444a6d4c084ee11e67c78eebec376d35;hb=fa2ae3a41572f5b762b761935fc712b59c2a6933;hp=3f4f781aa7dac6537bde69b93f6d79c469009450;hpb=0c4d79188ad0df9f35a0fb1131821d01af1418a7;p=mir.git diff --git a/source/mir/entity/EntityList.java b/source/mir/entity/EntityList.java index 3f4f781a..b2fc95ba 100755 --- a/source/mir/entity/EntityList.java +++ b/source/mir/entity/EntityList.java @@ -31,14 +31,20 @@ package mir.entity; -import java.lang.*; -import java.util.*; +import java.util.ArrayList; +import java.util.Set; -import freemarker.template.*; +import freemarker.template.TemplateListModel; +import freemarker.template.TemplateModel; -import mir.misc.*; -import mir.storage.*; -import mir.storage.store.*; +import mir.log.LoggerWrapper; +import mir.config.MirPropertiesConfiguration; +import mir.config.MirPropertiesConfiguration.PropertiesConfigExc; +import mir.storage.StorageObject; +import mir.storage.store.StorableObject; +import mir.storage.store.StoreContainerType; +import mir.storage.store.StoreIdentifier; +import mir.storage.store.StoreUtil; /** * @@ -52,8 +58,8 @@ import mir.storage.store.*; * @version 1.0 (freemarker compliant & and storable in ObjectStore) */ public class EntityList implements TemplateListModel, StorableObject { - - private static Logfile theLog; + protected static MirPropertiesConfiguration configuration; + protected LoggerWrapper logger; private ArrayList theEntityArrayList = new ArrayList(); private String whereClause, orderClause; private StorageObject theStorage; @@ -63,13 +69,20 @@ public class EntityList implements TemplateListModel, StorableObject { static { - theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Entity.Logfile")); + try { + configuration = MirPropertiesConfiguration.instance(); + } + catch (PropertiesConfigExc e) { + throw new RuntimeException("Unable to get configuration: " + e.getMessage()); + } } /** * Constructor. */ - public EntityList(){ } + public EntityList(){ + logger = new LoggerWrapper("Entity.List"); + } /* get/set EntityClass of Objects stored in EntityList */ public void setStorage(StorageObject storage) { this.theStorage=storage; } @@ -218,7 +231,7 @@ public class EntityList implements TemplateListModel, StorableObject { if (anEntity!=null) theEntityArrayList.add(anEntity); else - theLog.printWarning("EntityList: add called with empty Entity"); + logger.warn("EntityList: add called with empty Entity"); } @@ -291,7 +304,7 @@ public class EntityList implements TemplateListModel, StorableObject { StoreUtil.getEntityListUniqueIdentifierFor( theStorage.getTableName(), whereClause, orderClause, offset, limit )); } - theLog.printWarning("EntityList could not return StoreIdentifier"); + logger.warn("EntityList could not return StoreIdentifier"); return null; }