various fixes/cleanup: old producers are now completely gone, old logfile class too
[mir.git] / source / mir / entity / EntityList.java
index 3f4f781..b2fc95b 100755 (executable)
 
 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;
   }