changeset 42:5fbd8e65bdf5

Added debug output to DefaultArtifact tracing of artifact lifecyle easier. artifacts/trunk@121 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 24 Sep 2009 08:45:23 +0000
parents 5e4bc24ea438
children b8516aa3d8a1
files Changelog artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java
diffstat 2 files changed, 32 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Changelog	Wed Sep 23 16:55:12 2009 +0000
+++ b/Changelog	Thu Sep 24 08:45:23 2009 +0000
@@ -1,3 +1,8 @@
+2009-09-24	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java:
+	Added debug output to make tracing of artifact lifecyle easier.
+
 2009-09-23	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* artifact-database/doc/schema-pg.sql, artifact-database/doc/schema-h2.sql:
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java	Wed Sep 23 16:55:12 2009 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java	Thu Sep 24 08:45:23 2009 +0000
@@ -25,22 +25,39 @@
     }
 
     public String identifier() {
+        if (logger.isDebugEnabled()) {
+            logger.debug("DefaultArtifact.identifier: " + identifier);
+        }
         return this.identifier;
     }
 
     public String hash() {
-        return String.valueOf(hashCode());
+        String hash = String.valueOf(hashCode());
+        if (logger.isDebugEnabled()) {
+            logger.debug("DefaultArtifact.hashCode: " 
+                + identifier + " (" + hash + ")");
+        }
+        return hash;
     }
 
     public Document describe(CallContext context) {
+        if (logger.isDebugEnabled()) {
+            logger.debug("DefaultArtifact.describe: " + identifier);
+        }
         return XMLUtils.newDocument();
     }
 
     public Document advance(Document target, CallContext context) {
+        if (logger.isDebugEnabled()) {
+            logger.debug("DefaultArtifact.advance: " + identifier);
+        }
         return XMLUtils.newDocument();
     }
 
     public Document feed(Document target, CallContext context) {
+        if (logger.isDebugEnabled()) {
+            logger.debug("DefaultArtifact.feed: " + identifier);
+        }
         return XMLUtils.newDocument();
     }
 
@@ -51,13 +68,22 @@
     )
     throws IOException
     {
+        if (logger.isDebugEnabled()) {
+            logger.debug("DefaultArtifact.out: " + identifier);
+        }
     }
 
     public void setup(String identifier, ArtifactFactory factory, Object context) {
+        if (logger.isDebugEnabled()) {
+            logger.debug("DefaultArtifact.setup: " + identifier);
+        }
         this.identifier = identifier;
     }
 
     public void endOfLife(Object context) {
+        if (logger.isDebugEnabled()) {
+            logger.debug("DefaultArtifact.endOfLife: " + identifier);
+        }
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org