[Swift-commit] r2428 - trunk/src/org/griphyn/vdl/mapping
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Sat Jan 10 11:01:12 CST 2009
Author: benc
Date: 2009-01-10 11:01:10 -0600 (Sat, 10 Jan 2009)
New Revision: 2428
Modified:
trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
trunk/src/org/griphyn/vdl/mapping/DSHandle.java
trunk/src/org/griphyn/vdl/mapping/ExternalDataNode.java
Log:
separate getIdentifyingString method for presenting in log
Modified: trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java 2009-01-10 15:32:59 UTC (rev 2427)
+++ trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java 2009-01-10 17:01:10 UTC (rev 2428)
@@ -97,13 +97,26 @@
return this.value.toString();
}
}
+ return getIdentifyingString();
+ }
+
+ public String getIdentifyingString() {
+
String prefix = this.getClass().getName();
prefix = prefix + " identifier "+this.getIdentifier();
- prefix = prefix + " with no value at dataset=";
+ prefix = prefix + " type "+getType();
+ if(value == null) {
+ prefix = prefix + " with no value at dataset=";
+ } else if (value instanceof Throwable) {
+ prefix = prefix + " containing throwable "+value.getClass();
+ } else {
+ prefix = prefix + " value="+this.value.toString()+" dataset=";
+ }
+
prefix = prefix + getDisplayableName();
if (!Path.EMPTY_PATH.equals(getPathFromRoot())) {
@@ -118,6 +131,7 @@
}
return prefix;
+
}
protected String getDisplayableName() {
@@ -348,7 +362,7 @@
public synchronized void closeShallow() {
this.closed = true;
notifyListeners();
- logger.info("closed "+this.getIdentifier());
+ logger.info("closed "+this.getIdentifyingString());
// so because its closed, we can dump the contents
try {
logContent();
@@ -450,7 +464,7 @@
public synchronized void addListener(DSHandleListener listener) {
if (logger.isInfoEnabled()) {
Exception e = new Exception("To get stack trace");
- logger.info("Adding handle listener \"" + listener + "\" to \"" + this + "\"", e);
+ logger.info("Adding handle listener \"" + listener + "\" to \"" + getIdentifyingString() + "\"", e);
}
if (listeners == null) {
listeners = new LinkedList();
@@ -468,7 +482,7 @@
DSHandleListener listener = (DSHandleListener) i.next();
i.remove();
if (logger.isInfoEnabled()) {
- logger.info("Notifying listener \"" + listener + "\" about \"" + this + "\"");
+ logger.info("Notifying listener \"" + listener + "\" about \"" + getIdentifyingString() + "\"");
}
listener.handleClosed(this);
}
Modified: trunk/src/org/griphyn/vdl/mapping/DSHandle.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/DSHandle.java 2009-01-10 15:32:59 UTC (rev 2427)
+++ trunk/src/org/griphyn/vdl/mapping/DSHandle.java 2009-01-10 17:01:10 UTC (rev 2428)
@@ -83,5 +83,7 @@
public String getIdentifier();
+ public String getIdentifyingString();
+
public boolean isRestartable();
}
Modified: trunk/src/org/griphyn/vdl/mapping/ExternalDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/ExternalDataNode.java 2009-01-10 15:32:59 UTC (rev 2427)
+++ trunk/src/org/griphyn/vdl/mapping/ExternalDataNode.java 2009-01-10 17:01:10 UTC (rev 2428)
@@ -115,6 +115,10 @@
return prefix;
}
+ public String getIdentifyingString() {
+ return toString();
+ }
+
public DSHandle getRoot() {
return this;
}
More information about the Swift-commit
mailing list