From d25b8298ee956779478c7532d209292e7118ba06 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 6 Aug 2008 13:12:38 +0000 Subject: [PATCH] Add debug output for prototype handling. --- src/helma/framework/core/TypeManager.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/helma/framework/core/TypeManager.java b/src/helma/framework/core/TypeManager.java index 536e2674..818a250b 100644 --- a/src/helma/framework/core/TypeManager.java +++ b/src/helma/framework/core/TypeManager.java @@ -197,12 +197,21 @@ public final class TypeManager { } } + boolean debug = "true".equalsIgnoreCase(app.getProperty("helma.debugTypeManager")); + if (debug) { + System.err.println("Starting CHECK loop in " + Thread.currentThread()); + } + // loop through prototypes and check if type.properties needs updates // it's important that we do this _after_ potentially new prototypes // have been created in the previous loop. for (Iterator i = prototypes.values().iterator(); i.hasNext();) { Prototype proto = (Prototype) i.next(); + if (debug) { + System.err.println("CHECK: " + proto.getName() + " in " + Thread.currentThread()); + } + // update prototype's type mapping DbMapping dbmap = proto.getDbMapping(); @@ -216,6 +225,9 @@ public final class TypeManager { dbmap.update(); } } + if (debug) { + System.err.println("Finished CHECK in " + Thread.currentThread()); + } } private boolean isValidTypeName(String str) { @@ -285,11 +297,13 @@ public final class TypeManager { * @return the newly created prototype */ public synchronized Prototype createPrototype(String typename, Repository repository) { + if ("true".equalsIgnoreCase(app.getProperty("helma.debugTypeManager"))) { + System.err.println("CREATE: " + typename + " from " + repository + " in " + Thread.currentThread()); + // Thread.dumpStack(); + } Prototype proto = new Prototype(typename, repository, app); - // put the prototype into our map prototypes.put(proto.getLowerCaseName(), proto); - return proto; }