You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/02/03 02:38:00 UTC
svn commit: r502831 -
/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/LazyProxy.groovy
Author: jdillon
Date: Fri Feb 2 17:38:00 2007
New Revision: 502831
URL: http://svn.apache.org/viewvc?view=rev&rev=502831
Log:
Setup logging, and added trace logs when we load or re-load
Modified:
geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/LazyProxy.groovy
Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/LazyProxy.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/LazyProxy.groovy?view=diff&rev=502831&r1=502830&r2=502831
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/LazyProxy.groovy (original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/LazyProxy.groovy Fri Feb 2 17:38:00 2007
@@ -25,6 +25,9 @@
import java.lang.ref.SoftReference
+import org.apache.commons.logging.Log
+import org.apache.commons.logging.LogFactory
+
/**
* A lazy loading proxy, uses a closure to initialize the target and
* binds the target to a soft-reference to be heap friendly.
@@ -36,6 +39,8 @@
// have the magic going on...
//
+ private static Log log = LogFactory.getLog(this)
+
private Closure factory
private SoftReference reference
@@ -54,6 +59,11 @@
if (obj) {
return obj
}
+
+ log.trace('Re-loading target')
+ }
+ else {
+ log.trace('Loading target')
}
obj = factory.call()