You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gi...@apache.org on 2001/12/11 22:08:45 UTC
cvs commit: xml-cocoon2/src/org/apache/cocoon/generation StatusGenerator.java
giacomo 01/12/11 13:08:45
Modified: src/org/apache/cocoon/generation StatusGenerator.java
Log:
Displaying status
Submitted by: Sebastien Koechlin <sk...@ivision.fr>
Revision Changes Path
1.9 +18 -15 xml-cocoon2/src/org/apache/cocoon/generation/StatusGenerator.java
Index: StatusGenerator.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/StatusGenerator.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- StatusGenerator.java 2001/12/06 13:13:47 1.8
+++ StatusGenerator.java 2001/12/11 21:08:45 1.9
@@ -52,7 +52,8 @@
*
* @author <a href="mailto:paul@luminas.co.uk">Paul Russell</a> (Luminas Limited)
* @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.8 $ $Date: 2001/12/06 13:13:47 $
+ * @author <a href="mailto:skoechlin@ivision.fr">Sébastien Kœchlin</a> (iVision)
+ * @version CVS $Revision: 1.9 $ $Date: 2001/12/11 21:08:45 $
*/
public class StatusGenerator extends ComposerGenerator implements Recyclable {
@@ -181,28 +182,30 @@
Iterator i = this.storejanitor.iterator();
while( i.hasNext() ) {
Store store = (Store) i.next();
- startGroup(ch, store.getClass().getName()+" (hash = "+store.hashCode()+")" );
+ startGroup(ch, store.getClass().getName()+" (hash = 0x"+Integer.toHexString(store.hashCode())+")" );
int size = 0;
+ int empty = 0;
atts.addAttribute(namespace, "name", "name", "CDATA", "cached");
ch.startElement(namespace, "value", "value", atts);
// For each element in Store
Enumeration e = store.keys();
- List cachelist = new ArrayList();
+ atts.clear();
while( e.hasMoreElements() ) {
size++;
- atts.clear();
-
- ch.startElement(namespace, "line", "line", atts);
-
- Object o = e.nextElement();
- String value =
- o.toString() + " (hash: " +
- o.hashCode() + " | class: " +
- o.getClass().getName() +
+ Object key = e.nextElement();
+ Object val = store.get( key );
+ String line = null;
+ if( val == null ) {
+ empty++;
+ } else {
+ line = key.toString() + " (class: " +
+ val.getClass().getName() +
")" ;
-
- ch.characters(value.toCharArray(), 0, value.length());
+ ch.startElement(namespace, "line", "line", atts);
+ ch.characters(line.toCharArray(), 0, line.length());
ch.endElement(namespace, "line", "line");
+ };
+
};
@@ -216,7 +219,7 @@
ch.endElement(namespace, "value", "value");
- addValue(ch, "size", String.valueOf(size) + " items in cache");
+ addValue(ch, "size", String.valueOf(size) + " items in cache (" + empty + " are empty)");
endGroup(ch);
};
endGroup(ch);
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org