serious memory leak in the producer subsystem fixed
[mir.git] / source / mir / entity / AbstractEntity.java
index a56572e..108f424 100755 (executable)
@@ -44,7 +44,7 @@ import mir.storage.Database;
  * Base class the entities are derived from. Provides base functionality of
  * an entity.
  *
- * @version $Id: AbstractEntity.java,v 1.8.2.7 2005/03/26 11:26:23 zapata Exp $
+ * @version $Id: AbstractEntity.java,v 1.8.2.8 2005/10/30 00:46:57 zapata Exp $
  */
 
 public class AbstractEntity implements Entity {
@@ -52,11 +52,8 @@ public class AbstractEntity implements Entity {
 
   protected Map values;
   protected Database database;
-  protected LoggerWrapper logger;
 
   public AbstractEntity() {
-    logger = new LoggerWrapper("Entity");
-
     values = new HashMap();
   }
 
@@ -90,7 +87,7 @@ public class AbstractEntity implements Entity {
 
   /** {@inheritDoc} */
   public String insert() throws DatabaseExc {
-    logger.debug("Entity: trying to insert ...");
+    getLogger().debug("Entity: trying to insert ...");
 
     if (database != null) {
       return database.insert(this);
@@ -130,7 +127,7 @@ public class AbstractEntity implements Entity {
     if (hasField(theProp))
       values.put(theProp, theValue);
     else {
-      logger.warn("Entity.setFieldValue: Property not found: " + theProp + " (" + theValue + ")");
+      getLogger().warn("Entity.setFieldValue: Property not found: " + theProp + " (" + theValue + ")");
     }
   }
 
@@ -149,5 +146,9 @@ public class AbstractEntity implements Entity {
   public boolean hasField(String fieldName) throws DatabaseFailure {
     return getFieldNames().contains(fieldName);
   }
+
+  protected LoggerWrapper getLogger() {
+    return new LoggerWrapper("Entity");
+  }
 }